Skip to content

Commit

Permalink
fix auth error
Browse files Browse the repository at this point in the history
  • Loading branch information
otobot1 committed Aug 10, 2024
1 parent b025ac4 commit a236f69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ model Account {

model Session {
id String @id @default(cuid())
sessionToken String
sessionToken String @unique
user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Restrict)
userId String
expires DateTime
Expand Down
3 changes: 3 additions & 0 deletions src/server/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ declare module "next-auth" {


const getPermissionArray = (permissionsString: string): Permission[] => {
if (!permissionsString) return [];


const uncheckedStringArray = permissionsString.split(",");

if (!uncheckedStringArray.length) throw "uncheckedStringArray is empty";
Expand Down

0 comments on commit a236f69

Please sign in to comment.