Git Product home page Git Product logo

nextjs-passage-id-auth's Introduction

Determining workspace structure

Deciding which workspace information to collect

Gathering workspace info

NextJS with Passage Identity Demo App

This is a demo application showcasing how to integrate Passage Identity with a NextJS application.

Project Structure

The project is structured as follows:

  • src/: Contains the source code of the application.
    • app/: Contains the main application components.
      • login/: Contains the login page component.
      • page.tsx: The main page component.
      • layout.tsx: The main layout component.
    • hooks/: Contains custom React hooks.
      • useCurrentUser.ts: A custom hook for accessing the current user's data.
  • .env: Contains environment variables. You need to set up the environment variables for the Passage App ID and API Key.

Key Features

  • User authentication using Passage Identity.
  • Custom React hook for accessing the current user's data.
  • Protected routes that require user authentication. (TODO)
  • Middleware for checking user authentication. (TODO)

Setup

  1. Clone the repository.
  2. Install the dependencies using npm install.
  3. Set up the environment variables in the .env file:
    • PASSAGE_APP_ID: Your Passage App ID.
    • PASSAGE_API_KEY: Your Passage API Key.
  4. Run the application in development mode using npm run dev.

Usage

When you run the application, you will be redirected to the login page if you are not authenticated. After successful authentication, you will be redirected to the main page where you can see a welcome message with your username.

Notes

For chrome to work with passkeys you must run the server with TLS.

License

This project is licensed under the MIT License.

nextjs-passage-id-auth's People

Contributors

benjefferies avatar

Watchers

 avatar  avatar

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.