You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/authentication/lucia.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,21 +16,21 @@ Lucia needs to store your users and sessions in the database. So, your ZModel de
16
16
17
17
```zmodel title='/schema.zmodel'
18
18
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[]
23
23
24
-
@@allow('read', true)
25
-
@@allow('all', auth() == this)
24
+
@@allow('read', true)
25
+
@@allow('all', auth() == this)
26
26
}
27
27
28
28
model Session {
29
-
id String @id
30
-
userId String
31
-
expiresAt DateTime
29
+
id String @id
30
+
userId String
31
+
expiresAt DateTime
32
32
33
-
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
33
+
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
34
34
}
35
35
36
36
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';
0 commit comments