diff --git a/ui/app/components/auth/form/base.ts b/ui/app/components/auth/form/base.ts index 68b473fa56..bc15b31107 100644 --- a/ui/app/components/auth/form/base.ts +++ b/ui/app/components/auth/form/base.ts @@ -57,16 +57,16 @@ export default class AuthBase extends Component { 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) { diff --git a/ui/app/components/auth/form/github.js b/ui/app/components/auth/form/github.ts similarity index 100% rename from ui/app/components/auth/form/github.js rename to ui/app/components/auth/form/github.ts diff --git a/ui/app/components/auth/form/ldap.js b/ui/app/components/auth/form/ldap.ts similarity index 100% rename from ui/app/components/auth/form/ldap.js rename to ui/app/components/auth/form/ldap.ts diff --git a/ui/app/components/auth/form/oidc-jwt.ts b/ui/app/components/auth/form/oidc-jwt.ts index 971355ffce..76d141761b 100644 --- a/ui/app/components/auth/form/oidc-jwt.ts +++ b/ui/app/components/auth/form/oidc-jwt.ts @@ -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); } diff --git a/ui/app/components/auth/form/okta.ts b/ui/app/components/auth/form/okta.ts index abd0199f8e..6672db681b 100644 --- a/ui/app/components/auth/form/okta.ts +++ b/ui/app/components/auth/form/okta.ts @@ -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 diff --git a/ui/app/components/auth/form/radius.js b/ui/app/components/auth/form/radius.ts similarity index 100% rename from ui/app/components/auth/form/radius.js rename to ui/app/components/auth/form/radius.ts diff --git a/ui/app/components/auth/form/token.js b/ui/app/components/auth/form/token.ts similarity index 100% rename from ui/app/components/auth/form/token.js rename to ui/app/components/auth/form/token.ts diff --git a/ui/app/components/auth/form/userpass.js b/ui/app/components/auth/form/userpass.ts similarity index 93% rename from ui/app/components/auth/form/userpass.js rename to ui/app/components/auth/form/userpass.ts index d6c00e08bd..de28d0243a 100644 --- a/ui/app/components/auth/form/userpass.js +++ b/ui/app/components/auth/form/userpass.ts @@ -7,7 +7,7 @@ import AuthBase from './base'; /** * @module Auth::Form::Userpass - * + * see Auth::Base * */ export default class AuthFormUserpass extends AuthBase {