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:
parent
61fa88d5a1
commit
37f8b7fe98
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user