Email not found error returned correctyl
This commit is contained in:
parent
2f4bd04ab3
commit
7031bb1d48
@ -34,17 +34,10 @@ export default class UserController extends ApiController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let user;
|
const user = await this.idNotService.getOrCreateUser(idNotToken);
|
||||||
|
|
||||||
try {
|
|
||||||
user = await this.idNotService.getOrCreateUser(idNotToken);
|
|
||||||
} catch (error: any) {
|
|
||||||
this.httpUnauthorized(error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!user) {
|
if(!user) {
|
||||||
this.httpUnauthorized(response);
|
this.httpUnauthorized(response, "Email not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ export default class IdNotService extends BaseService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(!userToAdd.contact.email) {
|
if(!userToAdd.contact.email) {
|
||||||
throw new Error("No email found");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let userHydrated = User.hydrate<User>(userToAdd);
|
let userHydrated = User.hydrate<User>(userToAdd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user