Skip to content

Commit

Permalink
fix(#16): fix problems with callback URL on github
Browse files Browse the repository at this point in the history
  • Loading branch information
sametcodes committed Mar 6, 2023
1 parent ecdd221 commit 960cfc0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 43 deletions.
3 changes: 3 additions & 0 deletions pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export const authOptions = {
GithubProvider({
clientId: GITHUB_CLIENT_ID,
clientSecret: GITHUB_CLIENT_SECRET,
client: {
redirect_uris: [`${process.env.NEXTAUTH_URL}/api/auth/callback/github`],
},
}),
],
secret: process.env.JWT_SECRET,
Expand Down
87 changes: 44 additions & 43 deletions services/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ generator client {
}

model Platform {
id String @id @default(auto()) @map("_id") @db.ObjectId
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
code String @unique
code String @unique
raw_configuration Json?
methods Json
config Config[]
config Config[]
}

model User {
Expand All @@ -28,11 +28,11 @@ model User {
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
config Config[]
connections Connection[]
profiles ConnectionProfile[]
accounts Account[]
sessions Session[]
config Config[]
connections Connection[]
profiles ConnectionProfile[]
}

model Config {
Expand All @@ -45,51 +45,52 @@ model Config {
}

model Account {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
type String
provider String
providerAccountId String
refresh_token String? @db.String
access_token String? @db.String
expires_at Int?
token_type String?
scope String?
id_token String? @db.String
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
type String
provider String
providerAccountId String
refresh_token String? @db.String
access_token String? @db.String
expires_at Int?
token_type String?
scope String?
id_token String? @db.String
session_state String?
refresh_token_expires_in Int?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
}

model Connection {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
platformId String @db.ObjectId
refresh_token String @db.String
access_token String @db.String
expires_at Int
type String
token_type String
scope String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
profile ConnectionProfile?
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
platformId String @db.ObjectId
refresh_token String @db.String
access_token String @db.String
expires_at Int
type String
token_type String
scope String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
profile ConnectionProfile?
}

model ConnectionProfile {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
platformId String @db.ObjectId
connectionId String @db.ObjectId @unique
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
platformId String @db.ObjectId
connectionId String @unique @db.ObjectId
name String
email String
image String
name String
email String
image String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
connection Connection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
connection Connection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
}

model Session {
Expand Down

0 comments on commit 960cfc0

Please sign in to comment.