Skip to content

Commit a3538f1

Browse files
doc: signUp for local povider (#698)
1 parent 7865ba3 commit a3538f1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/content/3.application-side/2.session-access-and-management.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ lastRefreshedAt.value
7979
// Get / Reload the current session from the server, pass `{ required: true }` to force a login if no session exists
8080
await getSession()
8181

82+
// Trigger a sign-up, where `credentials` are the credentials your sign-up endpoint expects, e.g. `{ name:'Alice', email: '[email protected]', password: 'securepassword' }`
83+
await signUp(credentials);
84+
85+
// Trigger a sign-up with auto sign-in and redirect to the profile page within the application
86+
await signUp(credentials, { callbackUrl: '/profile', redirect: true });
87+
88+
// Trigger a sign-up with auto sign-in and redirect to an external website (https://external.example.com)
89+
await signUp(credentials, { callbackUrl: 'https://external.example.com', redirect: true, external: true });
90+
91+
// Trigger a sign-up without auto sign-in and redirect to the home page within the application
92+
await signUp(credentials, { callbackUrl: '/', redirect: true }, { preventLoginFlow: true });
93+
94+
// Trigger a sign-up without auto sign-in and doesn't redirect anywhere
95+
await signUp(credentials, undefined, { preventLoginFlow: true });
96+
8297
// Trigger a sign-in, where `credentials` are the credentials your sign-in endpoint expected, e.g. `{ username: 'bernd', password: 'hunter2' }`
8398
await signIn(credentials)
8499

0 commit comments

Comments
 (0)