From 8731f47b99af3e6890eaab68400464bebd03db03 Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Mon, 14 Nov 2022 08:50:38 +0100
Subject: User info page

---
 app/src/views/UserInfo.vue | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 app/src/views/UserInfo.vue

(limited to 'app/src/views/UserInfo.vue')

diff --git a/app/src/views/UserInfo.vue b/app/src/views/UserInfo.vue
new file mode 100644
index 0000000..f317cbd
--- /dev/null
+++ b/app/src/views/UserInfo.vue
@@ -0,0 +1,45 @@
+<template>
+  <ion-page>
+    <m6-header />
+    <ion-content :fullscreen="true">
+      <div>
+        <p>ID: {{ me.id }}</p>
+        <p>Name: {{ me.name }}</p>
+        <p>Email: {{ me.email }}</p>
+        <p>Is staff: {{ me.is_staff }}</p>
+      </div>
+    </ion-content>
+
+    <m6-footer />
+  </ion-page>
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+import { IonPage, IonContent } from "@ionic/vue";
+import Header from "@/components/Header.vue";
+import Footer from "@/components/Footer.vue";
+
+import { mapGetters, mapActions } from "vuex";
+
+export default defineComponent({
+  name: "UserInfo",
+  components: {
+    IonContent,
+    IonPage,
+    "m6-header": Header,
+    "m6-footer": Footer,
+  },
+  computed: {
+    ...mapGetters("auth", ["isLogged", "me"]),
+  },
+  created() {
+    if (!this.isLogged) window.location.href = "/sign";
+
+    this.getMe();
+  },
+  methods: {
+    ...mapActions("auth", ["getMe"]),
+  },
+});
+</script>
-- 
cgit v1.2.3-18-g5258

