Initial commit

This commit is contained in:
2019-01-15 13:21:24 +01:00
commit dc50642ed9
49 changed files with 10493 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
<template>
<div>
<app-loader v-if="!authFailed" overlay>
<h2>Authenticating...</h2>
</app-loader>
<app-message v-if="authFailed" :description="err.errorDescription" message="Failed to authenticate.">
<template slot="extras">
<Button type="primary" @click="triggerLogin">Log in</Button>
</template>
</app-message>
</div>
</template>
<script>
import auth from "~/utils/auth";
export default {
data() {
return {
authFailed: false,
err: {}
};
},
mounted() {
auth
.handleAuthentication()
.then(this.authorized)
.catch(this.unauthorized);
},
methods: {
authorized({ returnUrl }) {
this.$router.replace(returnUrl);
},
unauthorized(err) {
this.authFailed = true;
this.err = err;
},
triggerLogin() {
const errorState =
this.err && this.err.state ? JSON.parse(this.err.state) : null;
const returnUrl =
errorState && errorState.returnUrl ? errorState.returnUrl : "/";
auth.triggerLogin({ returnUrl });
}
}
};
</script>
+18
View File
@@ -0,0 +1,18 @@
<template>
<events />
</template>
<script>
import Events from "~/components/pages/events";
export default {
components: {
Events
},
head() {
return {
title: "Dancefinder - Events"
};
}
};
</script>
+17
View File
@@ -0,0 +1,17 @@
<template>
<app-message message="You are logged out.">
<h1 slot="icon">🎉</h1>
</app-message>
</template>
<script>
import auth from "~/utils/auth";
export default {
layout: "default",
mounted() {
auth.logout();
this.$router.replace('/')
}
};
</script>