mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #2728 from overleaf/jpa-ns-handle-422-when-adding-email
Improve error messaging if user adds affiliation that doesnt match domain matcher GitOrigin-RevId: 12c21c611c6a826ee7e41cc87613913aa58ac13e
This commit is contained in:
parent
0d442af07d
commit
117cd59b40
1 changed files with 10 additions and 0 deletions
|
@ -173,6 +173,16 @@ module.exports = UserEmailsController = {
|
|||
}
|
||||
}).withCause(error)
|
||||
)
|
||||
} else if (error.message === '422: Email does not belong to university') {
|
||||
return next(
|
||||
new HttpErrors.ConflictError({
|
||||
info: {
|
||||
public: {
|
||||
message: req.i18n.translate('email_does_not_belong_to_university')
|
||||
}
|
||||
}
|
||||
}).withCause(error)
|
||||
)
|
||||
}
|
||||
next(new HttpErrors.InternalServerError().withCause(error))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue