import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { TokenService } from '@core/services/token/token.service'; import { BlackbaudSsoRedirectResolver } from '@features/auth/resolvers/blackbaud-sso-redirect.resolver'; import { CardItem } from '@yourcause/common'; @Component({ selector: 'gc-dev-tools-wrapper-page', templateUrl: './dev-tools-wrapper-page.component.html' }) export class DevToolsWrapperPageComponent { devToolCards: CardItem[] = [{ title: 'Launch local instance', description: 'Launches an instance of the Platform pointed to localHost', i18nTitleKey: 'common:textLaunchLocalInstance', i18nDescriptionKey: 'common:textLaunchLocalInstanceDesc', action: this.launchLocalInstance(), icon: 'rocket' }]; constructor ( private bbSSOResolver: BlackbaudSsoRedirectResolver, private tokenService: TokenService, private activatedRoute: ActivatedRoute ) {} launchLocalInstance () { return () => { // store value in session storage // this will be used on return from SSO auth sessionStorage.setItem('redirectToLocalHost', 'true'); this.tokenService.logout(false, false); this.bbSSOResolver.resolve(this.activatedRoute.snapshot); }; } }