Auth
Using the Auth service, we can easily authenticate a user against various social services. Not only social services such as Google, Twitter, and LinkedIn, we can also set up a simple e-mail and password authentication as well. You can view a list of authentication providers here: http://docs.ionic.io/services/auth/#authentication-providers. And using the Auth
service, this is how we manage authentication:
import { Auth, UserDetails, IDetailedError } from '@ionic/cloud-angular'; @Component({ selector : 'auth-page' }) export class AuthPage { private testUser: UserDetails = { 'email': '[email protected]', 'password': 'password' }; // construct constructor( private auth: Auth, private user: User) {} signup() { this.auth.signup(testUser).then(() => { // testUser is now registered console.log(this.user) this.updateLastLogin(); // update user data }, (err: IDetailedError < string[] >...