Skip to content

Commit

Permalink
Replace remaining occurrences of isLoggedIn with isSignedIn (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans authored Jan 5, 2024
1 parent 8e33466 commit a19f1a7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/auth-express/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ For the router factories and route middleware, see the sections above for config
### `ExpressAuthSession`

- `client: Client`: `ext::auth::auth_token` global set based on the auth token that is present in the authentication cookie. If there is no cookie, the `Client` will be the original client that was passed when creating the `ExpressAuth` object.
- `isLoggedIn: () => Promise<boolean>`: Checks to see if this Request has a valid, unexpired auth token.
- `isSignedIn: () => Promise<boolean>`: Checks to see if this Request has a valid, unexpired auth token.

### `TokenData`

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-nextjs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@

### Usage

Now you have auth all configured and user's can signin/signup/etc. you can use the `auth.getSession()` method in your app pages to retrieve an `AuthSession` object. This session object allows you to check if the user is currently logged in with the `isLoggedIn` method, and also provides a `Client` object automatically configured with the `ext::auth::client_token` global, so you can run queries using the `ext::auth::ClientTokenIdentity` of the currently signed in user.
Now you have auth all configured and user's can signin/signup/etc. you can use the `auth.getSession()` method in your app pages to retrieve an `AuthSession` object. This session object allows you to check if the user is currently logged in with the `isSignedIn` method, and also provides a `Client` object automatically configured with the `ext::auth::client_token` global, so you can run queries using the `ext::auth::ClientTokenIdentity` of the currently signed in user.

```ts
import { auth } from "@/edgedb";

export default async function Home() {
const session = await auth.getSession();

const loggedIn = await session.isLoggedIn();
const loggedIn = await session.isSignedIn();

return (
<main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { auth } from "@/edgedb";
export default async function Home() {
const session = auth.getSession();

const signedIn = await session.isLoggedIn();
const signedIn = await session.isSignedIn();

return (
<main className={styles.main}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { auth } from "@/edgedb";
export default async function Home() {
const session = auth.getSession();

const signedIn = await session.isLoggedIn();
const signedIn = await session.isSignedIn();

return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { auth } from "@/edgedb";
export default async function Home() {
const session = auth.getSession();

const signedIn = await session.isLoggedIn();
const signedIn = await session.isSignedIn();

return (
<main className={styles.main}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { auth } from "@/edgedb";
export default async function Home() {
const session = auth.getSession();

const signedIn = await session.isLoggedIn();
const signedIn = await session.isSignedIn();

return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
Expand Down

0 comments on commit a19f1a7

Please sign in to comment.