feat(app): added redirect path cookie for use after signin #327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a feature to store the requested route that is outside the scope of the excluded routes. The route is stored in a cookie and disabled by default.
Types of changes
Description
I needed a way to have my application users be able to share a link to a page with users who potentially would not be registered or logged in. This Pull Request adds a cookie that is set when the client tries to hit a route that is not listed in the
redirectOptions.exclude
list, it then sets the cookie equal to theroute.to.fullPath
to include capturing the url parameters.I couldn't just use the redirectTo when using OAuth because using the
redirect: true
makes the module's middleware leave the route and always report it as/login
. I needed to capture the route BEFORE the Supabaseauth-redirect.mjs
middleware performed the redirect to the login page.I set my nuxt.config.ts values to reflect the changes:
This pull request has a modification to the
/pages/confirm.vue
in order to get the cookie.Checklist: