Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(AuthContext): Refactor to TypeScript and change dir #404

Merged
merged 7 commits into from
Jan 24, 2024

Conversation

EnzoVieira
Copy link
Member

Change AuthContext from /components to /context

@netlify
Copy link

netlify bot commented Dec 7, 2022

Deploy Preview for cesium-seium ready!

Name Link
🔨 Latest commit 3a07950
🔍 Latest deploy log https://app.netlify.com/sites/cesium-seium/deploys/639218dffd52590009eaceba
😎 Deploy Preview https://deploy-preview-404--cesium-seium.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@EnzoVieira EnzoVieira temporarily deployed to staging December 7, 2022 22:30 — with GitHub Actions Inactive
@@ -144,26 +178,25 @@ export function AuthProvider({ children }) {
setRefetch((needsRefetch) => !needsRefetch);
}

// Make the provider update only when it should
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've deleted this useMemo because it's generally used just for complex calcs (that is not this case).

This useMemo causes two renders, the first one because the states changed and second because the useMemo detects that someone from it's dependency array changed, causing unecessary renders.

@EnzoVieira EnzoVieira temporarily deployed to staging December 8, 2022 17:03 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

This pull request is being automatically deployed to Netlify.

✅ Preview: https://deploy-preview-404--seium.netlify.app/

@tiago-bacelar tiago-bacelar temporarily deployed to staging October 25, 2023 16:51 — with GitHub Actions Inactive
@EnzoVieira EnzoVieira temporarily deployed to staging October 26, 2023 17:40 — with GitHub Actions Inactive
@EnzoVieira EnzoVieira temporarily deployed to staging October 26, 2023 17:41 — with GitHub Actions Inactive
Copy link
Contributor

@tiago-bacelar tiago-bacelar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to run the formatter :)
After that, I think it's good to merge (if the github actions cooperate)

@diogogmatos
Copy link
Member

Copy link

netlify bot commented Nov 11, 2023

Deploy Preview for seium-stg ready!

Name Link
🔨 Latest commit 754e2e5
🔍 Latest deploy log https://app.netlify.com/sites/seium-stg/deploys/65a73bf7d62d53000857dc72
😎 Deploy Preview https://deploy-preview-404--seium-stg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

tiago-bacelar
tiago-bacelar previously approved these changes Nov 11, 2023
@tiago-bacelar
Copy link
Contributor

I took the opportunity of refactoring the auth context to fix an old bug logging in/out, where an error would appear in the console saying something along the lines of "Abort fetching route 'attendee/profile' ". To solve that, I added a new feature: much like blackboard, when you try to access a protected page while unauthenticated, instead of simply redirecting away, the original route is stored as a query param. That way, after the login is complete, the user is redirected to the original route.
It wasn't a marked issue or anything, it was just bugging me for a while :)

@tiago-bacelar tiago-bacelar removed their request for review December 8, 2023 22:12
Copy link
Member

@joaodiaslobo joaodiaslobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚀

@tiago-bacelar tiago-bacelar merged commit 12fc798 into main Jan 24, 2024
5 checks passed
@tiago-bacelar tiago-bacelar deleted the ev/refactor-auth-context branch January 24, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants