Giter VIP home page Giter VIP logo

sametcn99 / nextjs-cookie-based-auth Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 180 KB

This project has been created to learn how to implement JSON Web Token (JWT) and cookie-based authentication for only an administrator (admin) using Next.js.

Home Page: https://nextjs-cookie-based-auth-delta.vercel.app

TypeScript 93.89% CSS 4.64% JavaScript 1.47%
admin-auth authentication cookies example next nextjs nextjs14 react

nextjs-cookie-based-auth's Introduction

gif

nextjs-cookie-based-auth's People

Contributors

gadaotada avatar sametcn99 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gadaotada

nextjs-cookie-based-auth's Issues

in login route, nextresponse is not working correctly

Upon entering the correct password, a JWT token is generated successfully. This token is stored via browser cookies, and the login process is completed.
However, when the redirection process is conducted using NextResponse, the user appears as if they haven't logged in on the redirected page. The page still contains authentication checks that require the user to log in.
Surprisingly, when the user manually revisits the page, they appear as if they have logged in, and the auth process works correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.