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

Isolate authentication logic #48

Closed
pokhrelanmol opened this issue Aug 15, 2022 · 5 comments · Fixed by #53
Closed

Isolate authentication logic #48

pokhrelanmol opened this issue Aug 15, 2022 · 5 comments · Fixed by #53
Assignees

Comments

@pokhrelanmol
Copy link
Contributor

we have our auth logic inside the app.jsx and that's fine for the small project but if we want to scale, then I think we need to isolate the auth logic and set loggedIn user in a global user context so we can refer to it anywhere without worrying about prop drilling issue.

@mobo07
Copy link

mobo07 commented Aug 15, 2022

Hi, will it be okay if I achieve this with redux toolkit?

@Dharmik48
Copy link
Owner

Hi, will it be okay if I achieve this with redux toolkit?

We don't want to go into the redux domain yet.

@Dharmik48
Copy link
Owner

global user context

I think instead of context we should use a custom hook.

@pokhrelanmol
Copy link
Contributor Author

ya, custom hook can be a good option but a custom hook alone can create problems in future. instead, we can combine react context and custom hook and that would probably solve the complete issue.
you can refer this and this to get the complete overview.

You can assign me this task.

@Dharmik48
Copy link
Owner

Looks good, I'll assign you then🚀

pokhrelanmol added a commit to pokhrelanmol/dharmik-opesource-blog that referenced this issue Aug 17, 2022
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 a pull request may close this issue.

3 participants