Browse Source

Add logout function

master
Immanuel Onyeka 1 year ago
parent
commit
2a66cacd6f
2 changed files with 7 additions and 5 deletions
  1. +1
    -0
      components/app.vue
  2. +6
    -5
      components/sign-out.vue

+ 1
- 0
components/app.vue View File

@@ -153,6 +153,7 @@ function start() {
}).catch(error => { }).catch(error => {
console.log("An error occured %O", error) console.log("An error occured %O", error)
this.loadingError = "Could not initialize app." this.loadingError = "Could not initialize app."
window.location.hash = 'login'
}) })


} }


+ 6
- 5
components/sign-out.vue View File

@@ -3,20 +3,21 @@


<section class="inputs centered"> <section class="inputs centered">
<h4>Are you sure you want to log out?</h4> <h4>Are you sure you want to log out?</h4>
<button>Logout</button>
<button @click="logout">Logout</button>
</section> </section>


</div> </div>
</template> </template>


<script> <script>
function ready() {

function logout() {
document.cookie= "skouter="
window.location.reload()
} }


export default { export default {
methods: { methods: {
ready
logout
} }
} }
</script>
</script>

Loading…
Cancel
Save