rez_core 1.0.19 → 1.0.20

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": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -18,7 +18,13 @@ export class LoginService {
18
18
  async login(email: string, password: string) {
19
19
  console.log(process.env.master_key)
20
20
  const user = await this.userService.findByEmailId(email);
21
- if (!user) throw new BadRequestException('Your Email ID not registered.');
21
+ if (!user) {
22
+ return {
23
+ success: false,
24
+ message: 'Your Email ID not registered.',
25
+ type: 'email',
26
+ };
27
+ }
22
28
 
23
29
  const encryptedPassword = EncryptUtilService.encryptGCM(
24
30
  password,
@@ -27,7 +33,11 @@ export class LoginService {
27
33
  );
28
34
 
29
35
  if (encryptedPassword !== user.password) {
30
- throw new BadRequestException('Oops! Your password is incorrect.');
36
+ return {
37
+ success: false,
38
+ message: 'Oops! Your password is incorrect.',
39
+ type: 'password',
40
+ };
31
41
  }
32
42
 
33
43
  return this.userSessionService.createSession(user);