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

feat: don't reload your app and auth in a popup #336

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ManUtopiK
Copy link

Kooha-2025-02-04-03-38-18.webm

Comment on lines +5 to +15
const PROVIDERS = {
github: {
width: 960,
height: 600,
},
gitlab: {
width: 1100,
height: 650,
},
}

Copy link
Owner

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) => {
Copy link
Owner

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')

Copy link
Author

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 ?

Comment on lines 74 to 76
watch(isInPopup, () => {
fetch()
})
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
watch(isInPopup, () => {
fetch()
})
watch(isInPopup, fetch)

@atinux
Copy link
Owner

atinux commented Feb 4, 2025

Thank you for the ideas, I added somes notes :)

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.

2 participants