Skip to content

Commit

Permalink
Update useAuth.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-ru authored Sep 19, 2024
1 parent 68187aa commit 2372149
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/runtime/composables/local/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ const signIn: SignInFunc<Credentials, any> = async (credentials, signInOptions,
const { redirect = true, external } = signInOptions ?? {}
let { callbackUrl } = signInOptions ?? {}
if (typeof callbackUrl === 'undefined') {
if (useRoute()?.query?.redirect) {
callbackUrl = useRoute().query.redirect.toString()
const redirectQueryParam = useRoute()?.query?.redirect
if (redirectQueryParam) {
callbackUrl = redirectQueryParam.toString()
}
else {
callbackUrl = await determineCallbackUrl(runtimeConfig.public.auth, () => getRequestURLWN(nuxt))
Expand Down

0 comments on commit 2372149

Please sign in to comment.