mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05:00
UI: Smoke test and add mfa validation support for standard methods (#30424)
* =VAULT-34544 userpass * update args for okta and oidc-jwt * add todo * VAULT-34551 tested github login * VAULT-34550 tested radius login * VAULT-34545 tested ldap login * test token
This commit is contained in:
parent
d95b487e9e
commit
bdf9c4efd5
8 changed files with 8 additions and 6 deletions
|
|
@ -57,16 +57,16 @@ export default class AuthBase extends Component<Args> {
|
|||
selectedAuth: this.args.authType,
|
||||
});
|
||||
|
||||
this.handleAuthResponse(authResponse);
|
||||
this.handleAuthResponse(authResponse, this.args.authType, formData);
|
||||
} catch (error) {
|
||||
this.onError(error as Error);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
handleAuthResponse(authResponse: AuthData) {
|
||||
handleAuthResponse(authResponse: AuthData, authType: string, formData?: object) {
|
||||
// calls onAuthResponse in parent auth/page.js component
|
||||
this.args.onSuccess(authResponse);
|
||||
this.args.onSuccess(authResponse, authType, formData);
|
||||
}
|
||||
|
||||
onError(error: Error | string) {
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ export default class AuthFormOidcJwt extends AuthBase {
|
|||
|
||||
async continueLogin(data: JwtLoginData | OidcLoginData) {
|
||||
try {
|
||||
// TODO backend should probably be path, but holding off refactor since api service may remove need all together
|
||||
// OIDC callback returns a token so authenticate with that
|
||||
const backend = this.isOIDC && 'token' in data ? 'token' : this.args.authType;
|
||||
|
||||
|
|
@ -146,8 +147,9 @@ export default class AuthFormOidcJwt extends AuthBase {
|
|||
data,
|
||||
selectedAuth: this.args.authType,
|
||||
});
|
||||
|
||||
// responsible for redirect after auth data is persisted
|
||||
this.handleAuthResponse(authResponse);
|
||||
this.handleAuthResponse(authResponse, this.args.authType);
|
||||
} catch (error) {
|
||||
this.onError(error as Error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export default class AuthFormOkta extends AuthBase {
|
|||
selectedAuth: this.args.authType,
|
||||
});
|
||||
|
||||
this.handleAuthResponse(authResponse);
|
||||
this.handleAuthResponse(authResponse, this.args.authType);
|
||||
} catch (error) {
|
||||
// if a user fails the okta verify challenge, the POST login request fails (made by this.auth.authenticate above)
|
||||
// bubble those up for consistency instead of managing error state in this component
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import AuthBase from './base';
|
|||
|
||||
/**
|
||||
* @module Auth::Form::Userpass
|
||||
*
|
||||
* see Auth::Base
|
||||
* */
|
||||
|
||||
export default class AuthFormUserpass extends AuthBase {
|
||||
Loading…
Reference in a new issue