authelia/test/complete-config/mongo-broken-connection.ts
Clement Michaud 42581dfe93 Fix open redirection vulnerability.
In order to redirect the user after authentication, Authelia uses
rd query parameter provided by the proxy. However an attacker could
use phishing to make the user be redirected to a bad domain. In order
to avoid the user to be redirected to a bad location, Authelia now
verifies the redirection URL is under the protected domain.
2018-11-17 17:48:20 +01:00

18 lines
665 B
TypeScript

import WithDriver from '../helpers/with-driver';
import fullLogin from '../helpers/full-login';
import loginAndRegisterTotp from '../helpers/login-and-register-totp';
describe("Connection retry when mongo fails or restarts", function() {
this.timeout(30000);
WithDriver();
it("should be able to login after mongo restarts", function() {
const that = this;
let secret;
return loginAndRegisterTotp(that.driver, "john", true)
.then(_secret => secret = _secret)
.then(() => that.environment.restart_service("mongo", 1000))
.then(() => fullLogin(that.driver, "https://admin.example.com:8080/secret.html", "john", secret));
})
});