updated bb conf; login

This commit is contained in:
2023-03-01 16:54:26 +01:00
parent ca4480b122
commit c5dce08e20
4 changed files with 48 additions and 10 deletions

View File

@ -12,9 +12,9 @@ export const store = reactive({
/** true if a user is currently logged in */
loggedIn: ref(false),
/** Username of the currently logged in user */
/** Username of the currently logged-in user */
userName: ref("stranger"),
/** The host that runs basebox and waits for GraphQL requests */
baseboxHost: "http://127.0.0.1:8000",
baseboxHost: "http://127.0.0.1:8080",
})

View File

@ -1,11 +1,36 @@
<script setup>
import TheWelcome from '../components/TheAbout.vue'
import { store } from "../store";
/**
* Perform a login.
*/
function login() {
location.href = `${store.baseboxHost}/oauth/login`;
}
</script>
<template>
<main>
<!-- Force user to log in before he/she can see tasks. -->
<div v-if="!store.loggedIn" id="login-prompt">
<p>Your are currently not logged in.</p>
<button class="btn btn-primary" @click="login" type="button">Login</button>
</div>
</main>
</template>
<style lang="scss" scoped>
#login-prompt {
margin: 5rem 0;
border: 1px solid var(--color-border);
border-radius: .5rem;
padding: 2rem;
text-align: center;
.btn {
margin: 3rem 0 0 0;
}
}
</style>