WIP: Google login
This commit is contained in:
@@ -11,7 +11,7 @@ import { DeviceService } from '../services/device.service';
|
||||
templateUrl: './main-view.component.html',
|
||||
styleUrls: ['./main-view.component.scss']
|
||||
})
|
||||
export class MainViewComponent implements OnInit {
|
||||
export class MainViewComponent {
|
||||
@ViewChild('snav') snav?: MatSidenav;
|
||||
appVersion = packageInfo.version;
|
||||
|
||||
@@ -27,30 +27,6 @@ export class MainViewComponent implements OnInit {
|
||||
public _device: DeviceService
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
// @ts-ignore
|
||||
google.accounts.id.initialize({
|
||||
client_id: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com",
|
||||
callback: this.handleCredentialResponse.bind(this),
|
||||
auto_select: false,
|
||||
cancel_on_tap_outside: true,
|
||||
|
||||
});
|
||||
// @ts-ignore
|
||||
google.accounts.id.renderButton(
|
||||
// @ts-ignore
|
||||
document.getElementById("google-button"),
|
||||
{ theme: "outline", size: "large", width: "100%" }
|
||||
);
|
||||
// @ts-ignore
|
||||
google.accounts.id.prompt((notification: PromptMomentNotification) => { });
|
||||
}
|
||||
|
||||
async handleCredentialResponse(response: any) {
|
||||
// Here will be your response from Google.
|
||||
console.log(response);
|
||||
}
|
||||
|
||||
reloadApp() {
|
||||
document.location.reload();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user