Files
threshold-ui/ui/desktop/app/controllers/scopes/scope/authenticate/method/oidc.js
T

32 lines
828 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Controller, { inject as controller } from '@ember/controller';
import { action } from '@ember/object';
import { service } from '@ember/service';
2021-04-12 18:10:08 -04:00
export default class ScopesScopeAuthenticateMethodOidcController extends Controller {
@controller('scopes/scope/authenticate/method/index') authenticateMethod;
2021-04-12 18:10:08 -04:00
// =services
@service session;
@service router;
2021-04-12 18:10:08 -04:00
// =actions
2021-04-12 18:10:08 -04:00
/**
* Retry by starting a new OIDC authentication flow.
2021-04-12 18:10:08 -04:00
*/
@action
async retryAuthentication() {
const scope = this.authMethod.scope;
const authenticatorName = `authenticator:${this.authMethod.type}`;
await this.authenticateMethod.startOIDCAuthentication(authenticatorName, {
scope,
authMethod: this.authMethod,
});
2021-04-12 18:10:08 -04:00
}
}