Skip to content

Commit

Permalink
feat(auth): include workspace ID in login token generation
Browse files Browse the repository at this point in the history
Added support for passing the workspace ID when generating login tokens. This enhances token specificity and aligns with multi-workspace authentication requirements. Adjusted controller and token service to handle the additional parameter.
  • Loading branch information
AMoreaux committed Dec 20, 2024
1 parent f97ff87 commit 97fd185
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class MicrosoftAuthController {

const loginToken = await this.loginTokenService.generateLoginToken(
user.email,
workspace.id,
);

return res.redirect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export class LoginTokenService {
email: string,
workspaceId: string,
): Promise<AuthToken> {
const secret = this.jwtWrapperService.generateAppSecret('LOGIN');
const secret = this.jwtWrapperService.generateAppSecret(
'LOGIN',
workspaceId,
);

const expiresIn = this.environmentService.get('LOGIN_TOKEN_EXPIRES_IN');

Expand Down

0 comments on commit 97fd185

Please sign in to comment.