From 3c1ea60725d5145d5fe62f1f414ba55e761f623b Mon Sep 17 00:00:00 2001 From: Zai Shi Date: Wed, 13 Mar 2024 10:55:24 +0800 Subject: [PATCH] updated docs --- docs/docs/01-getting-started/02-users.md | 6 ++---- .../01-customization/02-examples/01-signin.md | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/docs/01-getting-started/02-users.md b/docs/docs/01-getting-started/02-users.md index 62b8da995..76efc9fc5 100644 --- a/docs/docs/01-getting-started/02-users.md +++ b/docs/docs/01-getting-started/02-users.md @@ -82,7 +82,7 @@ Call `useUser` (or `getUser`) with the `{ or: 'redirect' }` option to protect th ## Signing out -You can sign out the user by redirecting them to `/handler/signout` or simply by calling `user.signOut()`. +You can sign out the user by redirecting them to `/handler/signout` or simply by calling `user.signOut()`. The user will be redirected to `afterSignOut` URL. you can customize it in the `StackServerApp` constructor (see [here](/docs/api-documentation/app)). @@ -93,9 +93,7 @@ You can sign out the user by redirecting them to `/handler/signout` or simply by export default function SignOutButton() { const user = useUser(); - return ; } diff --git a/docs/docs/02-advanced-guides/01-customization/02-examples/01-signin.md b/docs/docs/02-advanced-guides/01-customization/02-examples/01-signin.md index 570cc90e2..d19d9e424 100644 --- a/docs/docs/02-advanced-guides/01-customization/02-examples/01-signin.md +++ b/docs/docs/02-advanced-guides/01-customization/02-examples/01-signin.md @@ -13,7 +13,7 @@ import { useStackApp, SignIn } from "@stackframe/stack"; export default function DefaultSignIn() { const app = useStackApp(); - return ; + return ; } ``` @@ -72,8 +72,9 @@ export default function CustomCredentialSignIn() { setError('Please enter your password'); return; } + // this will rediret to app.urls.afterSignIn if successful, you can customize it in the StackServerApp constructor const errorCode = await app.signInWithCredential({ email, password }); - // It is better to handle each error code separately, but for simplicity in this example, we will just show the error code directly + // It is better to handle each error code separately, but we will just show the error code directly for simplicity here if (errorCode) { setError(errorCode); }