forked from nuxt/example-auth0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
40 lines (37 loc) · 1.08 KB
/
index.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
<div>
<super-secret-div v-if="isAuthenticated"/>
<div class="content">
<h1>Hello, {{ loggedUser ? loggedUser.username : 'friend' }}!</h1>
<p>
This is a super simple example of how to use <a href="https://github.com/nuxt/nuxt.js" target="_blank">Nuxt.js</a> and <a hrf="https://auth0.com" target="_blank">Auth0</a> together.
</p>
<p v-if="!isAuthenticated">
You're not authenticated yet. Maybe you want to <nuxt-link to="/auth/sign-in" class="link">sign in</nuxt-link> and see what happens?
</p>
<p v-else>
Now that you're authenticated, maybe you should try going to our <nuxt-link to="/secret" class="link">super secret page</nuxt-link>!
</p>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import SuperSecretDiv from '~components/SuperSecretDiv'
export default {
computed: mapGetters([
'isAuthenticated',
'loggedUser'
]),
components: {
SuperSecretDiv
}
}
</script>
<style scoped>
.content {
max-width: 750px;
margin: 0 auto;
text-align: center;
}
</style>