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

bug/LBGG-590: Persistent login #616

Merged
merged 3 commits into from
Jun 23, 2024
Merged

bug/LBGG-590: Persistent login #616

merged 3 commits into from
Jun 23, 2024

Conversation

erunks
Copy link
Contributor

@erunks erunks commented Jun 19, 2024

What

Enables persistent logins across multiple tabs and windows by storing session data in a cookie

Changes

  • Use a cookie to store the
    • current user.
    • session token.
  • Mocked useCookie out in the tests

Link to Issue

Closes #590

Acceptance

Steps for testing

  • Log in to an account
  • Open a new tab
  • Verify you are still logged in

Copy link

netlify bot commented Jun 19, 2024

Deploy Preview for lbgg ready!

Name Link
🔨 Latest commit daf83cb
🔍 Latest deploy log https://app.netlify.com/sites/lbgg/deploys/6672cb72a13aad0008447047
😎 Deploy Preview https://deploy-preview-616--lbgg.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.

@erunks erunks self-assigned this Jun 19, 2024
@erunks erunks added bug Something isn't working enhancement New feature or request labels Jun 19, 2024
@erunks erunks requested review from buffet-time and TheTedder June 19, 2024 12:17
@erunks erunks mentioned this pull request Jun 19, 2024

export const useCookieMock = vi.fn((key: string, opts?: CookieOptions) => {
const cookie = toRef(cookies, key)
if (cookie.value === undefined && opts?.default) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if both cookie and opts.default don't have values? Won't we be returning an undefined ref?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's actually just how regular cookies work anyway.

@erunks erunks merged commit f64e34a into main Jun 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bug: Closing the tab logs you out
4 participants