Skip to content

Feat: Added the new feature stay signed in#58

Open
danieltate888 wants to merge 1 commit intodevfrom
feat/CP-20-stay-signed-in
Open

Feat: Added the new feature stay signed in#58
danieltate888 wants to merge 1 commit intodevfrom
feat/CP-20-stay-signed-in

Conversation

@danieltate888
Copy link

Added the new feature stay signed in:

  • Added and used logout mutation in two logout topbar and sidebar component
  • Added response interceptor in Apollo.ts to get new access token and x-auth-status and save into localstorage
  • Changed the 'Remember me' to 'Stay signed in' at LoginFormGroup.tsx
  • Changed the token validation logic, from token validation to auth status validation at auth.ts
  • Optimized the getUserInfo method implement logic in userHooks.ts. it should not run when at login page
  • Optimized the dependency of useEffect() in WrappedRoutes.tsx to implement the combined guard when url changed

Resolve CP-20

Screenshot:
Jest:
image

Steps to test:

  1. Change const refreshToken = this.jwtService.sign({ id: user.id }, { expiresIn: expiresFreshToken }); to const refreshToken = this.jwtService.sign({ id: user.id }, { expiresIn: '1m' }); at the auth.service.ts from backend
  2. Change else { accessToken = this.jwtService.sign({ id: user.id }); } at the auth.service.ts generateAccessToken function from backend
  3. Add getUserInfo method into any one component that to send a request, like in url http://localhost:5173/crypto/exchange
  4. activate the request at the page
  5. Wait for 1 minute, and click button exchanges, and then click any other button like Prices at Sidebar or refresh the page to see the effect. it will push to login page.

@danieltate888 danieltate888 force-pushed the feat/CP-20-stay-signed-in branch 2 times, most recently from 048e1dd to 87de795 Compare August 16, 2024 18:14
Added the new feature stay signed in:
- Added and used logout mutation in two logout topbar and sidebar component
- Added response interceptor in Apollo.ts to get new access token and x-auth-status and save into localstorage
- Changed the 'Remember me' to 'Stay signed in' at LoginFormGroup.tsx
- Changed the token validation logic, from token validation to auth status validation at auth.ts
- Optimized the getUserInfo method implement logic in userHooks.ts. it should not run when at login page
- Optimized the dependency of useEffect() in WrappedRoutes.tsx to implement the combined guard when url changed

Resolve CP-20
@danieltate888 danieltate888 force-pushed the feat/CP-20-stay-signed-in branch from 87de795 to 779114c Compare August 16, 2024 18:56
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.

1 participant