mirror of
https://github.com/kevin-DL/comedy-video-lib.git
synced 2026-01-22 15:25:16 +00:00
Authentication
- Installed magic-sdk - Created a login button with email - Store the token and user login state in the vuex store - Created a logout method that resets the store
This commit is contained in:
@@ -3,6 +3,17 @@
|
||||
<Nuxt />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Defaultlayout',
|
||||
async mounted() {
|
||||
const loggedIn = await this.$magic.user.isLoggedIn()
|
||||
const token = await this.$magic.user.getIdToken()
|
||||
this.$store.commit('auth/setToken', token)
|
||||
this.$store.commit('auth/setLoggedIn', loggedIn)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html {
|
||||
|
||||
Reference in New Issue
Block a user