owltide/components/LogIn.vue
Hornwitser 0d0e38e4b6 Refactor demo login as an authentication method
Use the authentication method system for the demo login and the
generated accounts.  This makes it possible to toggle it off on
production systems as these shouldn't have it enabled at all.
2025-07-09 18:01:26 +02:00

29 lines
741 B
Vue

<!--
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<div>
<LogInDemo v-if="authDemoEnabled" />
<LogInTelegram v-if="authTelegramEnabled" />
<template v-if="noAuth">No authentication method has been enabled in the configuration.</template>
</div>
</template>
<script lang="ts" setup>
const runtimeConfig = useRuntimeConfig();
const authDemoEnabled = runtimeConfig.public.authDemoEnabled;
const authTelegramEnabled = runtimeConfig.public.authTelegramEnabled;
const noAuth =
!authDemoEnabled
&& !authTelegramEnabled
;
</script>
<style lang="css" scoped>
div>* + *::before {
content: "\2013 or \2013 ";
display: block;
margin-block: 0.5rem;
}
</style>