Skip to content

Commit

Permalink
[QUIZ-fix -auth] fix: fix validate auth and add favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
trungdong11 committed Nov 14, 2024
1 parent 1c595f0 commit bb11cc2
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@

<head>
<meta charset="UTF-8">
<link rel="" href="/quizzfly/src/assets/img/logo.png">
<link rel="icon" href="/public/assets/images/favicon.jfif">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/login.css">
<link rel="stylesheet" href="/css/main.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<!-- <script src="https://accounts.google.com/gsi/client" async></script> -->
<title>QUIZZFLY</title>

<style>
body {
font-family: "Poppins", system-ui;
Expand Down
Binary file added public/assets/images/favicon.jfif
Binary file not shown.
Binary file removed public/favicon.ico
Binary file not shown.
12 changes: 10 additions & 2 deletions src/components/profile/ChangePasswordProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ import { changePasswordApi } from '@/services/auth'
const isLoading = ref(false)
const { handleSubmit } = useForm({
validationSchema: yup.object({
oldPassword: yup.string().required('Old password is required'),
newPassword: yup.string().required('New password is required'),
oldPassword: yup
.string()
.required('Old password is required')
.min(6, 'Password must be at least 6 characters')
.matches(/[A-Z]/, 'Password must contain uppercase letter'),
newPassword: yup
.string()
.required('New password is required')
.min(6, 'Password must be at least 6 characters')
.matches(/[A-Z]/, 'Password must contain uppercase letter'),
confirmNewPassword: yup
.string()
.oneOf([yup.ref('newPassword')], 'Passwords must match')
Expand Down
6 changes: 5 additions & 1 deletion src/pages/auth/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { googleTokenLogin } from 'vue3-google-login'
const { handleSubmit } = useForm({
validationSchema: yup.object({
email: yup.string().email().required('Email is required'),
password: yup.string().required('Password is required'),
password: yup
.string()
.required('Password is required')
.min(6, 'Password must be at least 6 characters')
.matches(/[A-Z]/, 'Password must contain uppercase letter'),
}),
})
Expand Down
6 changes: 5 additions & 1 deletion src/pages/auth/password/reset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const confirmDialog = useConfirmDialog()
const { errors, handleSubmit, defineField } = useForm({
validationSchema: yup.object({
password: yup.string().required('Password is required'),
password: yup
.string()
.required('Password is required')
.min(6, 'Password must be at least 6 characters')
.matches(/[A-Z]/, 'Password must contain uppercase letter'),
confirmPassword: yup
.string()
.oneOf([yup.ref('password')], 'Passwords must match')
Expand Down
6 changes: 5 additions & 1 deletion src/pages/auth/register/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ const { errors, handleSubmit, defineField } = useForm({
validationSchema: yup.object({
email: yup.string().email().required('Email is required'),
name: yup.string().required('Name is required'),
password: yup.string().required('Password is required'),
password: yup
.string()
.required('Password is required')
.min(6, 'Password must be at least 6 characters')
.matches(/[A-Z]/, 'Password must contain uppercase letter'),
confirmPassword: yup
.string()
.oneOf([yup.ref('password')], 'Passwords must match')
Expand Down

0 comments on commit bb11cc2

Please sign in to comment.