Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- export default Ember.Controller.extend({
- firebaseApp: Ember.inject.service(),
- actions: {
- signUp() {
- const auth = this.get('firebaseApp').auth();
- const email = this.get('email');
- const pass = this.get('password');
- auth.createUserWithEmailAndPassword(email, pass).then((userResponse) => {
- console.log('in createUserWithEmailAndPassword function');
- const user = this.store.createRecord('user', {
- id: userResponse.uid,
- email: userResponse.email,
- });
- return user.save();
- });
- }
- }
- });
- {{#if session.isAuthenticated}}
- <small style="color: white;">Logged in as {{session.currentUser.email}}</small>
- <button {{action "signOut"}} class="btn btn-success">Sign out</button>
- {{/if}}
- import Ember from 'ember';
- export default Ember.Component.extend({
- session: Ember.inject.service('session'),
- actions: {
- signOut() {
- this.get('signOut')();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement