-
Notifications
You must be signed in to change notification settings - Fork 500
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
Prevent CARE from reloading during sign in/out πββοΈ #6828
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
β Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
π Hi, @rithviknishad, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
LGTM |
@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us π₯. We always welcome your contribution π, so feel free to contribute to anything anytime, and never lose that spirit of innovation π. |
WHAT
π€[deprecated] Generated by Copilot at f64151f
Refactored authentication and sign out logic to use the
useAuthContext
hook and theAuthUserProvider
component. Simplified and cleaned up code in various components and files related to authentication. Fixed minor typos and bugs.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
π€[deprecated] Generated by Copilot at f64151f
Login
component to use theuseAuthContext
hook and thesignIn
function from the context (link,link)signOut
logic to be handled by theAuthUserProvider
component, and use theuseAuthContext
hook and thesignOut
function from the context in theSidebarUserCard
,SessionExpired
, andUserProfile
components (link,link,link,link,link,link,link,link)AuthUserProvider
component to use theuseCallback
hook to create thesignIn
andsignOut
functions, and pass them to theAuthUserContext
along with theuser
value (link,link,link)getRedirectURL
andgetRedirectOr
helper functions to theAuthUserProvider
component file, to handle the redirection logic aftersignIn
andsignOut
based on theredirect
query parameter (link)storage
event listener to theAuthUserProvider
component, to handle the sign out from another tab by calling thesignOut
function if the tokens are removed from the local storage (link)JwtTokenObtainPair
andLoginCredentials
interfaces from thesrc/Redux/api.tsx
file, and use them to type the response and the input of theroutes.login
endpoint (link,link)LoginInput
interface toLoginCredentials
for consistency with thesignIn
function (link)refresh
property of theTBody
property of theroutes.tokenRefresh
object to use therefresh
property of theJwtTokenObtainPair
interface (link)??
) instead of the logical OR operator (||
) to set thesilent
property of the merged request options, to avoid overriding thesilent
property if it is explicitly set tofalse
in the overrides (link)formatName
function from thesrc/Utils/utils.ts
file to display the user's name in theSidebarUserCard
component, instead of concatenating the first and last name manually (link)Login
component to use the term "unmounted" instead of "dismounted" (link)src/Routers/AppRouter.tsx
andsrc/Utils/utils.ts
files (link,link,link,link)