feat(frontend): Added functionality to the frontend to log in.
This commit is contained in:
parent
4a1edbb6ff
commit
a28ec22f29
20 changed files with 395 additions and 33 deletions
|
@ -1,8 +1,33 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
import {isLoggedIn, loginAs, logout, authState} from "@/store/auth-store.ts";
|
||||
|
||||
function loginAsStudent() {
|
||||
loginAs("student");
|
||||
}
|
||||
|
||||
function loginAsTeacher() {
|
||||
loginAs("teacher");
|
||||
}
|
||||
|
||||
function performLogout() {
|
||||
logout();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main></main>
|
||||
<main>
|
||||
<!-- TODO Placeholder implementation to test the login - replace by a more beautiful page later -->
|
||||
<div v-if="!isLoggedIn">
|
||||
<p>You are currently not logged in.</p>
|
||||
<v-btn @click="loginAsStudent">Login as student</v-btn>
|
||||
<v-btn @click="loginAsTeacher">Login as teacher</v-btn>
|
||||
</div>
|
||||
<div v-if="isLoggedIn">
|
||||
<p>You are currently logged in as {{ authState.user!.profile.name }} ({{ authState.activeRole }})</p>
|
||||
<v-btn @click="performLogout">Logout</v-btn>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue