respond 404 on email not found on sso connect

This commit is contained in:
2020-01-22 00:08:17 +01:00
parent 6746ca08e2
commit db744e5f31
2 changed files with 11 additions and 2 deletions

View File

@@ -59,7 +59,11 @@ fun Route.auth(
post<SsoRequest> {
val content = call.receive<SsoRequest.Content>()
ssoManager.sendMail(content.email, content.url)
try {
ssoManager.sendMail(content.email, content.url)
} catch (e: SsoManager.EmailNotFound) {
call.respond(HttpStatusCode.NotFound)
}
call.respond(HttpStatusCode.NoContent)
}