fix hardcoded header name xd
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
This commit is contained in:
parent
d6d6ebb682
commit
962fbe2947
@ -61,11 +61,11 @@ app.post("/api/login", (req, res) => {
|
||||
if (HTTP_REMOTE_USER_ENABLED) { // je rovno app.enabled('trust proxy')
|
||||
// Autentizace pomocí trusted headers
|
||||
const remoteUser = req.header(HTTP_REMOTE_USER_HEADER_NAME);
|
||||
const remoteName = req.header('remote-name');
|
||||
if (remoteUser && remoteUser.length > 0 && remoteName && remoteName.length > 0) {
|
||||
res.status(200).json(generateToken(Buffer.from(remoteName, 'latin1').toString(), true));
|
||||
//const remoteName = req.header('remote-name');
|
||||
if (remoteUser && remoteUser.length > 0 ) {
|
||||
res.status(200).json(generateToken(Buffer.from(remoteUser, 'latin1').toString(), true));
|
||||
} else {
|
||||
throw Error("Tohle nema nastat nekdo neco dela spatne.");
|
||||
throw Error("Je zapnuto přihlášení přes hlavičky, ale nepřišla hlavička nebo ??");
|
||||
}
|
||||
} else {
|
||||
// Klasická autentizace loginem
|
||||
|
Loading…
x
Reference in New Issue
Block a user