Skip to content

Commit 9765422

Browse files
docs: window.location.reload on signOut (#508)
* docs: window.location.reload on signOut Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> * 📄 Update LLMs.txt snapshot for PR review --------- Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bac6cc2 commit 9765422

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

.llms-snapshots/llms-full.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,15 +951,19 @@ import { signIn } from "@junobuild/core";await signIn({ nfid: { options: {
951951

952952
## Sign-out
953953

954-
You can end a user's session by logging them out.
954+
You can end a user's session, no matter which provider they used to sign in, by logging them out.
955955

956956
```
957957
import { signOut } from "@junobuild/core";await signOut();
958958
```
959959

960-
**Note:**
960+
By default, the page will automatically reload after a successful sign-out. This is a common pattern in logout flows that ensures the application restarts from a clean state.
961+
962+
If you wish to opt out, the library does clear its internal state and authentication before the reload, and you can use the `windowReload` option set to `false`.
961963

962-
This will clear the sign-in information stored in IndexedDB.
964+
```
965+
import { signOut } from "@junobuild/core";await signOut({ windowReload: false });
966+
```
963967

964968
---
965969

docs/build/authentication/development.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,19 +262,23 @@ await signIn({
262262

263263
## Sign-out
264264

265-
You can end a user's session by logging them out.
265+
You can end a user's session, no matter which provider they used to sign in, by logging them out.
266266

267267
```typescript
268268
import { signOut } from "@junobuild/core";
269269

270270
await signOut();
271271
```
272272

273-
:::note
273+
By default, the page will automatically reload after a successful sign-out. This is a common pattern in logout flows that ensures the application restarts from a clean state.
274274

275-
This will clear the sign-in information stored in IndexedDB.
275+
If you wish to opt out, the library does clear its internal state and authentication before the reload, and you can use the `windowReload` option set to `false`.
276276

277-
:::
277+
```typescript
278+
import { signOut } from "@junobuild/core";
279+
280+
await signOut({ windowReload: false });
281+
```
278282

279283
---
280284

0 commit comments

Comments
 (0)