Files
tabby-web/frontend/src/components/login.component.ts

34 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-06-27 16:28:49 +02:00
import { Component } from '@angular/core'
import { LoginService } from '../services/login.service'
2021-07-25 14:38:14 +02:00
import { CommonService } from '../services/common.service'
2021-06-27 16:28:49 +02:00
import { faGithub, faGitlab, faGoogle, faMicrosoft } from '@fortawesome/free-brands-svg-icons'
@Component({
selector: 'login',
templateUrl: './login.component.pug',
styleUrls: ['./login.component.scss'],
})
export class LoginComponent {
loggedIn: any
ready = false
providers = [
{ name: 'GitHub', icon: faGithub, cls: 'btn-primary', id: 'github' },
{ name: 'GitLab', icon: faGitlab, cls: 'btn-warning', id: 'gitlab' },
{ name: 'Google', icon: faGoogle, cls: 'btn-secondary', id: 'google-oauth2' },
{ name: 'Microsoft', icon: faMicrosoft, cls: 'btn-light', id: 'microsoft-graph' },
]
constructor (
private loginService: LoginService,
2021-07-25 14:38:14 +02:00
public commonService: CommonService,
2021-07-22 21:34:05 +02:00
) { }
2021-06-27 16:28:49 +02:00
async ngOnInit () {
await this.loginService.ready$.toPromise()
this.loggedIn = !!this.loginService.user
this.ready = true
}
}