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:
2020-11-07 20:56:38 +00:00
parent 01cc192ea8
commit de3d4d03c3
8 changed files with 157 additions and 25 deletions

19
components/Navbar.vue Normal file
View File

@@ -0,0 +1,19 @@
<template>
<div></div>
</template>
<script>
export default {
name: 'Navbar',
data() {},
methods: {
async logout() {
await this.$magic.user.logout()
this.$store.commit('auth/setToken', null)
this.$store.commit('auth/setLoggedIn', false)
},
},
}
</script>
<style lang="scss" scoped>
</style>