From d09a307ff8f734a0c7c63c58ace7ac20d35f0624 Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sun, 24 Mar 2019 19:28:32 +0100 Subject: [PATCH] Fix redirection after 2FA method change. Authelia was using links with href="#" that changed the URL when clicked on. Therefore, this commit removes the href property and apply link style to tags without href property. --- client/src/components/SecondFactorForm/SecondFactorForm.tsx | 4 ++-- client/src/components/SecondFactorTOTP/SecondFactorTOTP.tsx | 2 +- client/src/components/SecondFactorU2F/SecondFactorU2F.tsx | 2 +- client/src/index.css | 5 +++++ example/compose/nginx/backend/html/home/index.html | 4 ++-- test/helpers/context/DockerCompose.ts | 4 ++++ test/helpers/context/DockerEnvironment.ts | 4 ++++ test/suites/duo-push/environment.ts | 2 ++ 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/client/src/components/SecondFactorForm/SecondFactorForm.tsx b/client/src/components/SecondFactorForm/SecondFactorForm.tsx index 111d6021..9e3ea884 100644 --- a/client/src/components/SecondFactorForm/SecondFactorForm.tsx +++ b/client/src/components/SecondFactorForm/SecondFactorForm.tsx @@ -71,7 +71,7 @@ class SecondFactorForm extends Component { private renderUseAnotherMethodLink() { return (
- + Use another method
@@ -84,7 +84,7 @@ class SecondFactorForm extends Component {
Hello {this.props.username}
- Logout + Logout
diff --git a/client/src/components/SecondFactorTOTP/SecondFactorTOTP.tsx b/client/src/components/SecondFactorTOTP/SecondFactorTOTP.tsx index a64d3473..ba79ef5d 100644 --- a/client/src/components/SecondFactorTOTP/SecondFactorTOTP.tsx +++ b/client/src/components/SecondFactorTOTP/SecondFactorTOTP.tsx @@ -68,7 +68,7 @@ export default class SecondFactorTOTP extends React.Component { value={this.state.oneTimePassword} />
- Register new device diff --git a/client/src/components/SecondFactorU2F/SecondFactorU2F.tsx b/client/src/components/SecondFactorU2F/SecondFactorU2F.tsx index d58899d0..9ce86cf9 100644 --- a/client/src/components/SecondFactorU2F/SecondFactorU2F.tsx +++ b/client/src/components/SecondFactorU2F/SecondFactorU2F.tsx @@ -41,7 +41,7 @@ export default class SecondFactorU2F extends React.Component {
- Register new device diff --git a/client/src/index.css b/client/src/index.css index 4821f2cc..b3757ca5 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -9,3 +9,8 @@ code { font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } + +a { + text-decoration: underline; + cursor: pointer; +} \ No newline at end of file diff --git a/example/compose/nginx/backend/html/home/index.html b/example/compose/nginx/backend/html/home/index.html index 58b86b9f..c17a53d6 100644 --- a/example/compose/nginx/backend/html/home/index.html +++ b/example/compose/nginx/backend/html/home/index.html @@ -12,10 +12,10 @@ one of the following links to test access control powered by Authelia.
  • - public.example.com / index.html + public.example.com /
  • - secure.example.com / secret.html + secure.example.com / secret.html
  • singlefactor.example.com / secret.html diff --git a/test/helpers/context/DockerCompose.ts b/test/helpers/context/DockerCompose.ts index ddf6c963..0c9bb90f 100644 --- a/test/helpers/context/DockerCompose.ts +++ b/test/helpers/context/DockerCompose.ts @@ -23,6 +23,10 @@ class DockerCompose { async ps() { return Promise.resolve(execSync(this.commandPrefix + ' ps').toString('utf-8')); } + + async logs(service: string) { + await exec(this.commandPrefix + ' logs ' + service) + } } export default DockerCompose; \ No newline at end of file diff --git a/test/helpers/context/DockerEnvironment.ts b/test/helpers/context/DockerEnvironment.ts index 5d3f1e76..fe955ce2 100644 --- a/test/helpers/context/DockerEnvironment.ts +++ b/test/helpers/context/DockerEnvironment.ts @@ -11,6 +11,10 @@ class DockerEnvironment { await this.dockerCompose.up(); } + async logs(service: string) { + await this.dockerCompose.logs(service); + } + async stop() { await this.dockerCompose.down(); } diff --git a/test/suites/duo-push/environment.ts b/test/suites/duo-push/environment.ts index e52b040a..c612370b 100644 --- a/test/suites/duo-push/environment.ts +++ b/test/suites/duo-push/environment.ts @@ -3,6 +3,8 @@ import { exec } from "../../helpers/utils/exec"; import AutheliaServer from "../../helpers/context/AutheliaServer"; import DockerEnvironment from "../../helpers/context/DockerEnvironment"; +process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0 as any; + const autheliaServer = new AutheliaServer(__dirname + '/config.yml', [__dirname + '/users_database.yml']); const dockerEnv = new DockerEnvironment([ 'docker-compose.yml',