mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-17 23:06:04 +01:00
wip
This commit is contained in:
33
src/components/login.component.ts
Normal file
33
src/components/login.component.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { LoginService } from '../services/login.service'
|
||||
|
||||
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,
|
||||
) {
|
||||
this.providers = [this.providers[0]] // only keep GH for now
|
||||
}
|
||||
|
||||
async ngOnInit () {
|
||||
await this.loginService.ready$.toPromise()
|
||||
this.loggedIn = !!this.loginService.user
|
||||
this.ready = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user