Some changes
This commit is contained in:
@@ -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('/');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user