Skip to content

Commit 812fced

Browse files
chore: refactor useAuth composables to encapsulate context (#1024)
* chore: refactor useAuth composables to encapsulate context * chore: increase signup test timeout * fix: fix playground `signUp` usage * fix: middleware name in playground * enh: always return objects from `authjs` signIn --------- Co-authored-by: Zoey Kaiser <zoeykaiser8@gmail.com>
1 parent 4b3a590 commit 812fced

File tree

6 files changed

+504
-439
lines changed

6 files changed

+504
-439
lines changed

playground-authjs/pages/custom-signin.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ async function mySignInHandler({ username, password, callbackUrl }: { username:
1919
}
2020
else {
2121
// No error, continue with the sign in, e.g., by following the returned redirect:
22+
// Note that in failure cases (when `error` is not null) redirect is followed automatically,
23+
// i.e. `redirect` param only applies to successful sign-in.
2224
return navigateTo(url, { external: true })
2325
}
2426
}

playground-local/pages/protected/locally.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { definePageMeta } from '#imports'
33
44
// Note: This is only for testing, it does not make sense to do this with `globalAppMiddleware` turned on
55
definePageMeta({
6-
middleware: 'auth'
6+
middleware: 'sidebase-auth'
77
})
88
</script>
99

playground-local/pages/register.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function register() {
1414
response.value = await signUp({
1515
username: username.value,
1616
password: password.value
17-
}, undefined, { preventLoginFlow: true })
17+
}, { preventLoginFlow: true })
1818
}
1919
catch (error) {
2020
if (error instanceof FetchError) {

0 commit comments

Comments
 (0)