@@ -3,6 +3,7 @@ import { toTypedSchema } from '@vee-validate/zod';
33import { useForm } from ' vee-validate' ;
44import { onMounted , ref } from ' vue' ;
55import { useRouter } from ' vue-router' ;
6+ import { Info } from ' lucide-vue-next' ;
67import { Button } from ' @/components/ui/button' ;
78import {
89 Card ,
@@ -20,18 +21,29 @@ import {
2021 FormMessage ,
2122} from ' @/components/ui/form' ;
2223import { Input } from ' @/components/ui/input' ;
24+ import { api } from ' @/services/api' ;
2325import { useAuthStore } from ' @/stores/auth' ;
2426import { schemas } from ' @/types/zod' ;
2527
2628const router = useRouter ();
2729const authStore = useAuthStore ();
2830const loading = ref (false );
31+ const motd = ref <string | null >(null );
2932
3033const usernameInput = ref <InstanceType <typeof Input > | null >(null );
3134
32- onMounted (() => {
35+ onMounted (async () => {
3336 authStore .fetchProviders ();
3437 usernameInput .value ?.$el ?.focus ();
38+
39+ try {
40+ const response = await api .get <{ message: string | null }>(' /auth/motd' );
41+ if (response .data .message ) {
42+ motd .value = response .data .message ;
43+ }
44+ } catch (e ) {
45+ // Silently ignore if MOTD fetch fails
46+ }
3547});
3648
3749const formSchema = toTypedSchema (
@@ -68,7 +80,12 @@ const onSubmit = form.handleSubmit(async (values) => {
6880 </script >
6981
7082<template >
71- <div class =" flex items-center justify-center min-h-screen p-4" >
83+ <div class =" flex flex-col items-center justify-center min-h-screen p-4" >
84+ <div v-if =" motd" class =" w-full max-w-md mb-6 p-4 rounded-lg bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-900 text-blue-800 dark:text-blue-200 text-sm flex items-start shadow-sm" >
85+ <Info class="w-5 h-5 mr-3 shrink-0 mt-0.5 " />
86+ <div class =" leading-relaxed whitespace-pre-wrap" >{{ motd }}</div >
87+ </div >
88+
7289 <Card class="w-full max-w-md">
7390 <CardHeader class="space-y-1">
7491 <CardTitle class="text-2xl font-bold text-center">Sign In</CardTitle >
0 commit comments