Skip to content

Commit

Permalink
fix; upset reftoken
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonpada committed May 21, 2024
1 parent 026f31d commit 6df61fd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/oauth/oauth.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ export class OauthRepository {
},
});
await this.prismaService.$transaction([
this.prismaService.refreshToken.create({
data: {
this.prismaService.refreshToken.upsert({
where: {
token,
},
create: {
token,
scopes: [...scopes],
consent: {
Expand All @@ -81,6 +84,17 @@ export class OauthRepository {
},
},
},
update: {
scopes: [...scopes],
consent: {
connect: {
clientUuid_userUuid: {
clientUuid: client.uuid,
userUuid: user.uuid,
},
},
},
},
}),
this.prismaService.consent.update({
where: {
Expand Down

0 comments on commit 6df61fd

Please sign in to comment.