Skip to content

Commit

Permalink
fix(sso|auth): fix sso signinup (#9651)
Browse files Browse the repository at this point in the history
Renamed `user` to `payload` for better context clarity and updated
related references. Adjusted the login token generation to use
`workspace.id`, improving readability and maintainability of the code.
  • Loading branch information
AMoreaux authored Jan 15, 2025
1 parent f722a2d commit 789ff30
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class SSOAuthController {
}

private async generateLoginToken(
user: { email: string } & Record<string, string>,
payload: { email: string } & Record<string, string>,
identityProvider: WorkspaceSSOIdentityProvider,
) {
if (!identityProvider) {
Expand All @@ -149,16 +149,16 @@ export class SSOAuthController {

const existingUser = await this.userRepository.findOne({
where: {
email: user.email,
email: payload.email,
},
});

const { userData } = this.authService.formatUserDataPayload(
user,
payload,
existingUser,
);

await this.authService.signInUp({
const { workspace, user } = await this.authService.signInUp({
userData,
workspace: identityProvider.workspace,
authParams: {
Expand All @@ -170,7 +170,7 @@ export class SSOAuthController {
identityProvider,
loginToken: await this.loginTokenService.generateLoginToken(
user.email,
identityProvider.workspace.id,
workspace.id,
),
};
}
Expand Down

0 comments on commit 789ff30

Please sign in to comment.