email not found error
This commit is contained in:
parent
4544b7209b
commit
2f4bd04ab3
@ -33,7 +33,15 @@ export default class UserController extends ApiController {
|
|||||||
this.httpValidationError(response, "IdNot token undefined");
|
this.httpValidationError(response, "IdNot token undefined");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const user = await this.idNotService.getOrCreateUser(idNotToken);
|
|
||||||
|
let user;
|
||||||
|
|
||||||
|
try {
|
||||||
|
user = await this.idNotService.getOrCreateUser(idNotToken);
|
||||||
|
} catch (error: any) {
|
||||||
|
this.httpUnauthorized(error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(!user) {
|
if(!user) {
|
||||||
this.httpUnauthorized(response);
|
this.httpUnauthorized(response);
|
||||||
|
@ -359,6 +359,10 @@ export default class IdNotService extends BaseService {
|
|||||||
updated_at: null,
|
updated_at: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(!userToAdd.contact.email) {
|
||||||
|
throw new Error("No email found");
|
||||||
|
}
|
||||||
|
|
||||||
let userHydrated = User.hydrate<User>(userToAdd);
|
let userHydrated = User.hydrate<User>(userToAdd);
|
||||||
const user = await this.userService.create(userHydrated);
|
const user = await this.userService.create(userHydrated);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user