import { __awaiter, __decorate } from "tslib";
import { customElement } from '@microsoft/fast-element';
import { BaseRoute } from '../base';
import { commonLoginRouteStyles } from '../../styles';
import { ProtectedTemplate as template } from './protected.template';
let Protected = class Protected extends BaseRoute {
    onLogout() {
        return __awaiter(this, void 0, void 0, function* () {
            const result = yield this.auth.logout();
            if (!result.success) {
                return;
            }
            yield this.credentialManager.preventSilentAccess();
            this.onNavigate('login');
        });
    }
};
Protected = __decorate([
    customElement({
        name: 'foundation-login-protected',
        template,
        styles: commonLoginRouteStyles,
    })
], Protected);
export { Protected };
//# sourceMappingURL=protected.js.map