requireauth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package requireauth provides middleware that rejects requests unless an authenticated user has been placed on the request by earlier middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Options) express.Handler

New returns middleware that responds with 401 unless the configured request value has been set (for example by an authentication middleware).

Types

type Options

type Options struct {
	// Key is the request value name that must be present for the request to
	// proceed. Defaults to "user".
	Key string
}

Options configures the require-auth middleware.

Jump to

Keyboard shortcuts

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