mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { Component } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { AuthService } from '@app/shared';
|
|
|
|
@Component({
|
|
selector: 'sqx-home-page',
|
|
styleUrls: ['./home-page.component.scss'],
|
|
templateUrl: './home-page.component.html',
|
|
})
|
|
export class HomePageComponent {
|
|
public showLoginError = false;
|
|
|
|
constructor(
|
|
private readonly authService: AuthService,
|
|
private readonly router: Router,
|
|
) {
|
|
}
|
|
|
|
public login() {
|
|
if (this.isIE()) {
|
|
this.authService.loginRedirect();
|
|
} else {
|
|
this.authService.loginPopup()
|
|
.subscribe(() => {
|
|
this.router.navigate(['/app']);
|
|
}, () => {
|
|
this.showLoginError = true;
|
|
});
|
|
}
|
|
}
|
|
|
|
public isIE() {
|
|
const isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g);
|
|
|
|
return isIE;
|
|
}
|
|
}
|
|
|