-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat: don't reload your app and auth in a popup #336
base: main
Are you sure you want to change the base?
Conversation
const PROVIDERS = { | ||
github: { | ||
width: 960, | ||
height: 600, | ||
}, | ||
gitlab: { | ||
width: 1100, | ||
height: 650, | ||
}, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have the providers with fixed width/height
@@ -38,12 +49,48 @@ export function useUserSession(): UserSessionComposable { | |||
} | |||
} | |||
|
|||
const isInPopup = useCookie('temp-nuxt-auth-utils-popup') | |||
|
|||
const openInPopup = (provider, route) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather have onpenInPopup('/auth/github', { width: 690, height: 600 })
with default values for both width & height so we could have openInPopup('/auth/github')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With and Height are here to match the minimal size of the website provider and prevent scrollbars. The goal is to display the popup at the minimal size.
Are you sure to force developers to remember which is the perfect size for each providers, and set it for each providers ?
watch(isInPopup, () => { | ||
fetch() | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
watch(isInPopup, () => { | |
fetch() | |
}) | |
watch(isInPopup, fetch) |
Thank you for the ideas, I added somes notes :) |
Kooha-2025-02-04-03-38-18.webm