diff --git a/src/learning-token-backend/src/modules/auth/auth.controller.ts b/src/learning-token-backend/src/modules/auth/auth.controller.ts index ef6d8919..d3167e92 100644 --- a/src/learning-token-backend/src/modules/auth/auth.controller.ts +++ b/src/learning-token-backend/src/modules/auth/auth.controller.ts @@ -56,7 +56,7 @@ export class AuthController { throw new NotFoundException('Invalid Credentials') } } catch (error) { - throw new NotFoundException('Invalid Credentials') + throw new NotFoundException('An error occured') } } diff --git a/src/learning-token-backend/src/modules/auth/service/auth.service.ts b/src/learning-token-backend/src/modules/auth/service/auth.service.ts index b472c1c4..b5c003d7 100644 --- a/src/learning-token-backend/src/modules/auth/service/auth.service.ts +++ b/src/learning-token-backend/src/modules/auth/service/auth.service.ts @@ -151,7 +151,7 @@ export class AuthService { token: token, createdAt: user.createdAt, updatedAt: user.updatedAt, - role: user.role.name + role: user.role?.name } } diff --git a/src/learning-token-dashboard/src/pages/Register.tsx b/src/learning-token-dashboard/src/pages/Register.tsx index e924dcfe..01e331db 100644 --- a/src/learning-token-dashboard/src/pages/Register.tsx +++ b/src/learning-token-dashboard/src/pages/Register.tsx @@ -74,6 +74,7 @@ const Login = () => { name: values.name, email: values.email, password: values.password, + type: 'Admin' }) .unwrap() .then((result: any) => { @@ -81,6 +82,7 @@ const Login = () => { loginAdmin({ email: values.email, password: values.password, + type: 'Admin' }) .unwrap() .then((res: any) => {