Closed vdias38 closed 7 years ago
/*
export interface IUser {
$key?: string,
firstName: string,
lastName: string,
email: string
}
export class User implements IUser {...}
*/
/src
/models
user.model.ts
/*
export class UserProvider {
create(...) {
return new User(...)
}
update(){}
delete(){}
fetchById(){}
fetchByEditorId(){}
fetchAll(){}
==? changePassword(){}
}
*/
/providers
/user
user.ts
export class AuthProvider {
registerUser(...) {
return this.af2Auth.auth.createUserWithEmailAndPassword(user.email, user.password);
}
saveUserData(....) {
return this.af.database.object('users/' + uid).set({
name: name,
email: email,
});
}
}
/auth
auth.ts
/*
export class UsersListPage {
createUser(...) {
this.userService.create(...)
}
}
*/
/pages
/users-list
users-list.ts
/user-form
user-form.ts
/login
==? /account
ionViewCanEnter: Fired before entering into a view, allows you to control whether the view can be accessed or not (returning true or false).
https://javebratt.com/ionic-firebase-authentication/ https://progblog.io/Angular-2-Firebase-Tutorial-Part-4-Adding-Email-Password-Authentication/ https://www.firebase.com/docs/web/guide/user-auth.html