mirror of
https://github.com/kevin-DL/breeze-next-template.git
synced 2026-01-11 18:34:27 +00:00
add js strict equality
This commit is contained in:
@@ -34,7 +34,7 @@ const Navigation = ({ user }) => {
|
||||
<div className="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
|
||||
<NavLink
|
||||
href="/dashboard"
|
||||
active={router.pathname == '/dashboard'}>
|
||||
active={router.pathname === '/dashboard'}>
|
||||
Dashboard
|
||||
</NavLink>
|
||||
</div>
|
||||
@@ -110,7 +110,7 @@ const Navigation = ({ user }) => {
|
||||
<div className="pt-2 pb-3 space-y-1">
|
||||
<ResponsiveNavLink
|
||||
href="/dashboard"
|
||||
active={router.pathname == '/dashboard'}>
|
||||
active={router.pathname === '/dashboard'}>
|
||||
Dashboard
|
||||
</ResponsiveNavLink>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ export const useAuth = ({ middleware, redirectIfAuthenticated } = {}) => {
|
||||
.post('/register', props)
|
||||
.then(() => revalidate())
|
||||
.catch(error => {
|
||||
if (error.response.status != 422) throw error
|
||||
if (error.response.status !== 422) throw error
|
||||
|
||||
setErrors(Object.values(error.response.data.errors).flat())
|
||||
})
|
||||
@@ -44,7 +44,7 @@ export const useAuth = ({ middleware, redirectIfAuthenticated } = {}) => {
|
||||
.post('/login', props)
|
||||
.then(() => revalidate())
|
||||
.catch(error => {
|
||||
if (error.response.status != 422) throw error
|
||||
if (error.response.status !== 422) throw error
|
||||
|
||||
setErrors(Object.values(error.response.data.errors).flat())
|
||||
})
|
||||
@@ -60,7 +60,7 @@ export const useAuth = ({ middleware, redirectIfAuthenticated } = {}) => {
|
||||
.post('/forgot-password', { email })
|
||||
.then(response => setStatus(response.data.status))
|
||||
.catch(error => {
|
||||
if (error.response.status != 422) throw error
|
||||
if (error.response.status !== 422) throw error
|
||||
|
||||
setErrors(Object.values(error.response.data.errors).flat())
|
||||
})
|
||||
@@ -99,8 +99,8 @@ export const useAuth = ({ middleware, redirectIfAuthenticated } = {}) => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (middleware == 'guest' && redirectIfAuthenticated && user) router.push(redirectIfAuthenticated)
|
||||
if (middleware == 'auth' && error) logout()
|
||||
if (middleware === 'guest' && redirectIfAuthenticated && user) router.push(redirectIfAuthenticated)
|
||||
if (middleware === 'auth' && error) logout()
|
||||
}, [user, error])
|
||||
|
||||
return {
|
||||
|
||||
@@ -25,7 +25,7 @@ const Login = () => {
|
||||
const [status, setStatus] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (router.query.reset?.length > 0 && errors.length == 0) {
|
||||
if (router.query.reset?.length > 0 && errors.length === 0) {
|
||||
setStatus(atob(router.query.reset))
|
||||
} else {
|
||||
setStatus(null)
|
||||
|
||||
@@ -31,7 +31,7 @@ const VerifyEmail = () => {
|
||||
gladly send you another.
|
||||
</div>
|
||||
|
||||
{status == 'verification-link-sent' && (
|
||||
{status === 'verification-link-sent' && (
|
||||
<div className="mb-4 font-medium text-sm text-green-600">
|
||||
A new verification link has been sent to the email
|
||||
address you provided during registration.
|
||||
|
||||
Reference in New Issue
Block a user