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(space-nuxt-base): remove init_oauth stale cookie deletion and move to app-extension-auth #66

Merged

Conversation

BibiSebi
Copy link
Contributor

@BibiSebi BibiSebi commented Jul 3, 2024

What?

  • Removing functionality to reset the session cookie. This logic should be handled by app-extension-auth library.
  • Add forwarding of init_oauth query parameter.

Why?

This problem and solution are necessary as there is no way to remove the cookies when a plugin is uninstalled. This can cause issues when a plugin is reinstalled as the old cookie is persisted. When app-extension-auth finds that there is a cookie, it will try to use it, even when it is not valid anymore.

JIRA: SHAPE-5947

This PR depends and can only be merged after #38 is merged and a new version of app-extension-auth is released.

@BibiSebi BibiSebi requested a review from eunjae-lee July 3, 2024 09:04
@BibiSebi BibiSebi changed the title feat(nuxt-base): remove init_oauth stale cookie deletion and move to app-extension-auth feat(space-nuxt-base): remove init_oauth stale cookie deletion and move to app-extension-auth Jul 3, 2024
if (queryParams['init_oauth'] === 'true') {
return await sendRedirect(
event,
`${appConfig.auth.initOauthFlowUrl}?init_oauth=true`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think initOauthFlowUrl will likely already include ?, but just in case, could we do this a bit differently like

const url = new URL(appConfig.auth.initOauthFlowUrl);
// add `init_oauth` to `url`

Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

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

I'll apply my suggestion in another PR :D

@eunjae-lee eunjae-lee merged commit 05504c6 into main Jul 3, 2024
1 of 2 checks passed
@eunjae-lee eunjae-lee deleted the SHAPE-5947-remove-stale-cookie-inside-app-extension-auth branch July 3, 2024 13:46
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