feat(core): Prevent session hijacking (#9057)
This commit is contained in:
committed by
GitHub
parent
5793e5644a
commit
28261047c3
@@ -94,7 +94,7 @@ export class AuthController {
|
||||
}
|
||||
}
|
||||
|
||||
this.authService.issueCookie(res, user);
|
||||
this.authService.issueCookie(res, user, req.browserId);
|
||||
void this.internalHooks.onUserLoginSuccess({
|
||||
user,
|
||||
authenticationMethod: usedAuthenticationMethod,
|
||||
|
||||
@@ -164,7 +164,7 @@ export class InvitationController {
|
||||
|
||||
const updatedUser = await this.userRepository.save(invitee, { transaction: false });
|
||||
|
||||
this.authService.issueCookie(res, updatedUser);
|
||||
this.authService.issueCookie(res, updatedUser, req.browserId);
|
||||
|
||||
void this.internalHooks.onUserSignup(updatedUser, {
|
||||
user_type: 'email',
|
||||
|
||||
@@ -85,7 +85,7 @@ export class MeController {
|
||||
|
||||
this.logger.info('User updated successfully', { userId });
|
||||
|
||||
this.authService.issueCookie(res, user);
|
||||
this.authService.issueCookie(res, user, req.browserId);
|
||||
|
||||
const updatedKeys = Object.keys(payload);
|
||||
void this.internalHooks.onUserUpdate({
|
||||
@@ -138,7 +138,7 @@ export class MeController {
|
||||
const updatedUser = await this.userRepository.save(user, { transaction: false });
|
||||
this.logger.info('Password updated successfully', { userId: user.id });
|
||||
|
||||
this.authService.issueCookie(res, updatedUser);
|
||||
this.authService.issueCookie(res, updatedUser, req.browserId);
|
||||
|
||||
void this.internalHooks.onUserUpdate({
|
||||
user: updatedUser,
|
||||
|
||||
@@ -83,7 +83,7 @@ export class OwnerController {
|
||||
|
||||
this.logger.debug('Setting isInstanceOwnerSetUp updated successfully');
|
||||
|
||||
this.authService.issueCookie(res, owner);
|
||||
this.authService.issueCookie(res, owner, req.browserId);
|
||||
|
||||
void this.internalHooks.onInstanceOwnerSetup({ user_id: owner.id });
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ export class PasswordResetController {
|
||||
|
||||
this.logger.info('User password updated successfully', { userId: user.id });
|
||||
|
||||
this.authService.issueCookie(res, user);
|
||||
this.authService.issueCookie(res, user, req.browserId);
|
||||
|
||||
void this.internalHooks.onUserUpdate({
|
||||
user,
|
||||
|
||||
Reference in New Issue
Block a user