Admin plugin authorization

auth.ts
admin({
adminRole: ['ADMIN'],
defaultRole: 'COMPANY',
adminUserIds: ['cljlpoqzz0000q94giwo6pd5z'],
roles: {
ADMIN: undefined,
ADMINHIDDEN: undefined,
SUPERVISOR: undefined,
SUPPORT: undefined,
STAFF: undefined,
COMPANY: undefined,
LAB: undefined,
},
}),
admin({
adminRole: ['ADMIN'],
defaultRole: 'COMPANY',
adminUserIds: ['cljlpoqzz0000q94giwo6pd5z'],
roles: {
ADMIN: undefined,
ADMINHIDDEN: undefined,
SUPERVISOR: undefined,
SUPPORT: undefined,
STAFF: undefined,
COMPANY: undefined,
LAB: undefined,
},
}),
schema:
model User {
id String @id @default(cuid())
createdAt DateTime @default(now()) @db.Timestamptz(6)
updatedAt DateTime @updatedAt @db.Timestamptz(6)
username String @unique
name String?
name_en String?
displayUsername String?
image String?
role Role


enum Role {
ADMIN
ADMINHIDDEN
SUPERVISOR
STAFF
COMPANY
}
model User {
id String @id @default(cuid())
createdAt DateTime @default(now()) @db.Timestamptz(6)
updatedAt DateTime @updatedAt @db.Timestamptz(6)
username String @unique
name String?
name_en String?
displayUsername String?
image String?
role Role


enum Role {
ADMIN
ADMINHIDDEN
SUPERVISOR
STAFF
COMPANY
}
after upgrade to latest version، Admin plugin not works! how can edit admin in auth.ts config so can admin access the admin panel?
2 Replies
bekacru
bekacru5w ago
are you on 1.2.3?
yasserconnect
yasserconnectOP5w ago
i was on 1.2.2, and after upgrade to 1.2.3 it fixed thanks a lot @bekacru.

Did you find this page helpful?