jwt

command module
v0.0.0-...-838b099 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 8 Imported by: 0

README

Simple Web Form Submission and JWT Auth

This example implements web form submission Go. This is a login application where the user signs in with his/her username and password. Once a user is authenticated, the application will persist the session using JWT.

This application has the following functions:

  1. Reads a file from the filesystem and streams the static file content to the web as a web form for the user to log in.
  2. Handles the submitted form.
  3. Persists a JWT in a cookie when the user is authenticated successfully.
  4. Redirects the user to another static web page called welcome page, which is only accessible to authorized users. The application examines if a valid JWT is in the request.
  5. Disables browser caching on the welcome page.

Setup

  1. Run the server

    $ make run
    
  2. Launch a web browser and navigate to http://localhost:8000.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL