Skip to content

Commit 66ef8cf

Browse files
committed
use consistent indentation
1 parent 61c7d1c commit 66ef8cf

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

docs/guides/authentication/lucia.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ Lucia needs to store your users and sessions in the database. So, your ZModel de
1616

1717
```zmodel title='/schema.zmodel'
1818
model User {
19-
id String @id @default(uuid())
20-
userName String @unique
21-
password String @omit
22-
sessions Session[]
19+
id String @id @default(uuid())
20+
userName String @unique
21+
password String @omit
22+
sessions Session[]
2323
24-
@@allow('read', true)
25-
@@allow('all', auth() == this)
24+
@@allow('read', true)
25+
@@allow('all', auth() == this)
2626
}
2727
2828
model Session {
29-
id String @id
30-
userId String
31-
expiresAt DateTime
29+
id String @id
30+
userId String
31+
expiresAt DateTime
3232
33-
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
33+
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
3434
}
3535
3636
The data field names and types in the `session` model must exactly match the ones in the above. While you can change the model names, the relation name in the session model (`Session.user`) must be the camel-case version of the user model name. For example, if the user model was named `AuthUser`, the relation must be named `Session.authUser`.
@@ -106,10 +106,10 @@ import { enhance } from '@zenstackhq/runtime';
106106
export const prisma = new PrismaClient();
107107

108108
export async function getEnhancedPrisma(): Promise<PrismaClient> {
109-
const { user } = await validateRequest();
110-
// create a wrapper of Prisma client that enforces access policy,
111-
// data validation, and @password, @omit behaviors
112-
return enhance(prisma, { user: {id: user?.id!}});
109+
const { user } = await validateRequest();
110+
// create a wrapper of Prisma client that enforces access policy,
111+
// data validation, and @password, @omit behaviors
112+
return enhance(prisma, { user: {id: user?.id!}});
113113
}
114114
```
115115

0 commit comments

Comments
 (0)