Some changes

This commit is contained in:
2024-07-01 17:29:57 +02:00
parent 15271a873b
commit 673eb10b7b
7 changed files with 53 additions and 11 deletions

View File

@@ -3,6 +3,8 @@ import { Form, Field } from 'vee-validate';
import * as Yup from 'yup';
import { axiosInstance } from '@/main'
import { router } from '@/router/router'
import { useUserStore } from '@/stores/user.store'
import { storeToRefs } from 'pinia'
const schema = Yup.object().shape({
username: Yup.string().required('Nazwa użytkownika jest wymagana'),
@@ -25,6 +27,8 @@ async function onSubmit(values : any, { setErrors } : any) {
}
});
if(body != undefined && body.status == 200) {
const userStore = useUserStore();
localStorage.setItem("username", username);
await router.push('/');
}