Skip to content

Commit

Permalink
ajust login positive
Browse files Browse the repository at this point in the history
  • Loading branch information
AldemirLucas committed Jan 19, 2024
1 parent 73403b9 commit 5119100
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions next/middlewares/authUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ async function isJWTInvalid(token) {
export default async function authUser(context, destiny) {
const { req, res } = context

// const invalidToken = await isJWTInvalid(req.cookies.token)
const invalidToken = true
const invalidToken = await isJWTInvalid(req.cookies.token)

if (invalidToken) {
cookies.remove('userBD', { path: '/' })
Expand Down
2 changes: 1 addition & 1 deletion next/pages/user/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function Login() {
}

const fetchToken = async ({ email, password }) => {
const result = await getToken({email: "email", password: "password"})
const result = await getToken({email: email, password: password})

if(result?.tokenAuth === null || result?.errors?.length > 0) return setErrors({login:"E-mail ou senha incorretos."})

Expand Down

0 comments on commit 5119100

Please sign in to comment.