This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from "firebase/app"; | |
const actions = { | |
authAction({ commit }) { | |
firebase.auth().onAuthStateChanged(user => { | |
if (user) { | |
commit("setUser", user); | |
} else { | |
commit("setUser", null); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<navbar /> | |
<section v-if="isUserAuth" class="section"> | |
<div class="columns"> | |
<div class="column is-half is-offset-one-quarter"> | |
Welcome {{ getUser.email }} | |
</div> | |
</div> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from "firebase/app"; | |
const actions = { | |
signUpAction({ commit }, payload) { | |
firebase | |
.auth() | |
.createUserWithEmailAndPassword(payload.email, payload.password) | |
.then(response => { | |
commit("setUser", response.user); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from "firebase/app"; | |
const actions = { | |
signUpAction({ commit }, payload) { | |
firebase | |
.auth() | |
.createUserWithEmailAndPassword(payload.email, payload.password) | |
.then(response => { | |
commit("setUser", response.user); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="columns" v-if="!isUserAuth"> | |
<div class="column is-half is-offset-one-quarter"> | |
<div class="card"> | |
<div class="card-content"> | |
<div | |
v-if="validationErrors.length" | |
class="notification is-danger is-light" | |
> | |
<button @click="resetError()" class="delete"></button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="columns" v-if="!isUserAuth"> | |
<div class="column is-half is-offset-one-quarter"> | |
<div class="card"> | |
<div class="card-content"> | |
<div | |
v-if="validationErrors.length" | |
class="notification is-danger is-light" | |
> | |
<button @click="resetError()" class="delete"></button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="columns" v-if="!isUserAuth"> | |
<div class="column is-half is-offset-one-quarter"> | |
<div class="card"> | |
<div class="card-content"> | |
<div | |
v-if="validationErrors.length" | |
class="notification is-danger is-light" | |
> | |
<button @click="resetError()" class="delete"></button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<navbar /> | |
<section v-if="isUserAuth" class="section"> | |
<div class="columns"> | |
<div class="column is-half is-offset-one-quarter"> | |
Welcome {{ getUser.email }} | |
</div> | |
</div> | |
</section> |
NewerOlder