Browse Source

Update user linking to OIDC by changing provider from ANONYMOUS to OIDC

pull/6075/head
Germán Martín 2 weeks ago
parent
commit
e1a68e82f2
  1. 4
      apps/api/src/app/auth/auth.service.ts

4
apps/api/src/app/auth/auth.service.ts

@ -137,10 +137,10 @@ export class AuthService {
throw new Error('Only users with token authentication can link OIDC'); throw new Error('Only users with token authentication can link OIDC');
} }
// Update user with thirdPartyId (keeping provider as ANONYMOUS for dual auth) // Update user with thirdPartyId and switch provider to OIDC
await this.userService.updateUser({ await this.userService.updateUser({
where: { id: userId }, where: { id: userId },
data: { thirdPartyId } data: { thirdPartyId, provider: 'OIDC' }
}); });
return this.jwtService.sign({ id: userId }); return this.jwtService.sign({ id: userId });

Loading…
Cancel
Save