本文整理匯總了TypeScript中@ionic/cloud-angular.Auth類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Auth類的具體用法?TypeScript Auth怎麽用?TypeScript Auth使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Auth類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(public storage: Storage, public navCtrl: NavController, public navParams: NavParams, public auth:Auth,) {
this.storage.set('email', null);
this.storage.set('password', null);
this.fireAuth = firebase.auth();
this.auth.logout();
this.navCtrl.setRoot(LoginPage);
}
示例2: logout
logout() {
//switch based on social login, could be better
if(this.user.social && this.user.social.facebook) {
this.facebookAuth.logout();
} else {
this.auth.logout();
}
this.navCtrl.setRoot(LoginPage);
}
示例3:
this.platform.ready().then(() => {
this.isWindows = this.platform.is('windows');
if(this.platform.is('cordova')) {
this.isAuthenticated = this.auth.isAuthenticated();
// Google Analytics and user settings no applicable on Windows Phone
if(!this.isWindows) {
GoogleAnalytics.trackView('Home Page');
if(this.user.social.facebook && this.user.social.facebook.uid) {
this.currUser = {
id: this.user.social.facebook.uid,
name: this.user.social.facebook.data.full_name,
photo: this.user.social.facebook.data.profile_picture
};
}
}
}
});
示例4: doTwitter
doTwitter() {
console.log('do Twitter');
this.auth.login('twitter').then(() => {
this.navCtrl.setRoot(HomePage);
});
}
示例5: logout
logout() {
this.auth.logout();
this.navCtrl.setRoot(LoginPage);
}