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.
This commit is contained in:
Clement Michaud 2019-03-24 19:28:32 +01:00
parent 4eaafb7115
commit d09a307ff8
8 changed files with 21 additions and 6 deletions

View File

@ -71,7 +71,7 @@ class SecondFactorForm extends Component<Props> {
private renderUseAnotherMethodLink() { private renderUseAnotherMethodLink() {
return ( return (
<div className={styles.anotherMethodLink}> <div className={styles.anotherMethodLink}>
<a href="#" onClick={this.props.onUseAnotherMethodClicked}> <a onClick={this.props.onUseAnotherMethodClicked}>
Use another method Use another method
</a> </a>
</div> </div>
@ -84,7 +84,7 @@ class SecondFactorForm extends Component<Props> {
<div className={styles.header}> <div className={styles.header}>
<div className={styles.hello}>Hello <b>{this.props.username}</b></div> <div className={styles.hello}>Hello <b>{this.props.username}</b></div>
<div className={styles.logout}> <div className={styles.logout}>
<a onClick={this.props.onLogoutClicked} href="#">Logout</a> <a onClick={this.props.onLogoutClicked}>Logout</a>
</div> </div>
</div> </div>
<div className={styles.body}> <div className={styles.body}>

View File

@ -68,7 +68,7 @@ export default class SecondFactorTOTP extends React.Component<Props, State> {
value={this.state.oneTimePassword} /> value={this.state.oneTimePassword} />
</TextField> </TextField>
<div className={styles.registerDeviceContainer}> <div className={styles.registerDeviceContainer}>
<a className={classnames(styles.registerDevice, 'register-totp')} href="#" <a className={classnames(styles.registerDevice, 'register-totp')}
onClick={this.props.onRegisterOneTimePasswordClicked}> onClick={this.props.onRegisterOneTimePasswordClicked}>
Register new device Register new device
</a> </a>

View File

@ -41,7 +41,7 @@ export default class SecondFactorU2F extends React.Component<Props, State> {
<CircleLoader status={u2fStatus}></CircleLoader> <CircleLoader status={u2fStatus}></CircleLoader>
</div> </div>
<div className={styles.registerDeviceContainer}> <div className={styles.registerDeviceContainer}>
<a className={classnames(styles.registerDevice, 'register-u2f')} href="#" <a className={classnames(styles.registerDevice, 'register-u2f')}
onClick={this.props.onRegisterSecurityKeyClicked}> onClick={this.props.onRegisterSecurityKeyClicked}>
Register new device Register new device
</a> </a>

View File

@ -9,3 +9,8 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace; monospace;
} }
a {
text-decoration: underline;
cursor: pointer;
}

View File

@ -12,10 +12,10 @@
one of the following links to test access control powered by Authelia.<br/> one of the following links to test access control powered by Authelia.<br/>
<ul> <ul>
<li> <li>
public.example.com <a href="https://public.example.com:8080/"> / index.html</a> public.example.com <a href="https://public.example.com:8080/"> /</a>
</li> </li>
<li> <li>
secure.example.com <a href="https://secure.example.com:8080/"> / secret.html</a> secure.example.com <a href="https://secure.example.com:8080/secret.html"> / secret.html</a>
</li> </li>
<li> <li>
singlefactor.example.com <a href="https://singlefactor.example.com:8080/secret.html"> / secret.html</a> singlefactor.example.com <a href="https://singlefactor.example.com:8080/secret.html"> / secret.html</a>

View File

@ -23,6 +23,10 @@ class DockerCompose {
async ps() { async ps() {
return Promise.resolve(execSync(this.commandPrefix + ' ps').toString('utf-8')); return Promise.resolve(execSync(this.commandPrefix + ' ps').toString('utf-8'));
} }
async logs(service: string) {
await exec(this.commandPrefix + ' logs ' + service)
}
} }
export default DockerCompose; export default DockerCompose;

View File

@ -11,6 +11,10 @@ class DockerEnvironment {
await this.dockerCompose.up(); await this.dockerCompose.up();
} }
async logs(service: string) {
await this.dockerCompose.logs(service);
}
async stop() { async stop() {
await this.dockerCompose.down(); await this.dockerCompose.down();
} }

View File

@ -3,6 +3,8 @@ import { exec } from "../../helpers/utils/exec";
import AutheliaServer from "../../helpers/context/AutheliaServer"; import AutheliaServer from "../../helpers/context/AutheliaServer";
import DockerEnvironment from "../../helpers/context/DockerEnvironment"; 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 autheliaServer = new AutheliaServer(__dirname + '/config.yml', [__dirname + '/users_database.yml']);
const dockerEnv = new DockerEnvironment([ const dockerEnv = new DockerEnvironment([
'docker-compose.yml', 'docker-compose.yml',