Skip to content

Instantly share code, notes, and snippets.

@enappd
Last active July 26, 2021 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enappd/7231aed9f42b609ca6a76a666fdbf2ff to your computer and use it in GitHub Desktop.
Save enappd/7231aed9f42b609ca6a76a666fdbf2ff to your computer and use it in GitHub Desktop.
Ionic Angular Capacitor Google Login
import { Component } from '@angular/core';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor() { }
ionViewDidEnter() {
GoogleAuth.init();
}
async doLogin() {
const user = await GoogleAuth.signIn();
if (user) { this.goToHome(user); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment