golangAuthTemplate

command module
v0.0.0-...-2fdef8e Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 4 Imported by: 0

README

Simple Authentication Template

This project provides a straightforward implementation of session management and CSRF tokens for user authentication. It serves as a template for building secure applications using Go, utilizing the standard library for most functionalities, with minimal external dependencies.

Features

  • User Registration:
    • Users can register using their email and password.
  • Login & Logout:
    • Authentication is handled with session tokens, allowing users to log in and out seamlessly.
  • Protected Routes:
    • Access to certain routes, such as /show-users, is restricted and requires valid session and CSRF tokens for access.
  • Basic Middleware:
    • A simple middleware implementation is included to handle authentication without relying on external packages.
  • Custom Router:
    • A basic routing mechanism is implemented to manage different endpoints without third-party libraries.
  • Data Storage:
    • For demonstration purposes, user data is stored in a simple in-memory map.
  • Validation:
    • Input validation is performed using the validator package (v9.31.0+incompatible).

Usage

This template provides a foundational structure for building secure authentication mechanisms in Go applications. You can extend it to include additional features as needed.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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