1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #~: http code with login fails (#2149)

This commit is contained in:
Jorge Miguel Lobo Escalona 2022-06-14 11:10:47 +02:00 committed by GitHub
parent 61fa88d5a1
commit 37f8b7fe98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,7 @@ const loginUser = (
if (value && value.USER && !err) {
success(value)
} else {
error()
error(err)
}
}
@ -103,11 +103,14 @@ const auth = (
}
/**
* Run if no have information.
* Catch error login.
*
* @param {string} err - error.
*/
const error = () => {
updaterResponse(new Map(unauthorized).toObject())
writeInLogger(unauthorized)
const error = (err) => {
const httpCodeError = err ? internalServerError : unauthorized
updaterResponse(new Map(httpCodeError).toObject())
writeInLogger(httpCodeError)
next()
}