rez_core 2.2.142 → 2.2.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.2.142",
3
+ "version": "2.2.144",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -41,8 +41,8 @@ export class EmailService {
41
41
  }
42
42
  }
43
43
 
44
- // fire-and-forget
45
- const result = await this.mailerService
44
+ // fire-and-forget // removed await
45
+ const result = this.mailerService
46
46
  .sendMail({
47
47
  to: email,
48
48
  subject,
@@ -61,8 +61,17 @@ export class LoginController {
61
61
  let { email, name } = req.user; // Extracted from Google Strategy
62
62
 
63
63
  // Call LoginService to validate user, create session, and return JWT
64
- const token = await this.loginService.loginWithGoogle(email, name);
65
- return res.redirect(`${this.configService.get('BASE_URL')}?token=${token}`);
64
+ const data = await this.loginService.loginWithGoogle(email, name);
65
+
66
+ if (!('accessToken' in data) || !data.accessToken)
67
+ return res.redirect(
68
+ `${this.configService.get('BASE_URL')}/auth?email=${email}&error='User not found'`,
69
+ );
70
+
71
+ const { accessToken, appcode } = data;
72
+ return res.redirect(
73
+ `${this.configService.get('BASE_URL')}/auth?token=${accessToken}&appcode=${appcode}`,
74
+ );
66
75
  }
67
76
 
68
77
  @UseGuards(JwtAuthGuard)
@@ -255,7 +255,7 @@ export class LoginService {
255
255
  }
256
256
 
257
257
  // Create session (Same as JWT login flow)
258
- return this.userSessionService.createSession(user);
258
+ return await this.login(email, undefined, true);
259
259
  }
260
260
 
261
261
  async logout(sessionKey: string) {