authenticated-controller

command
v12.2.0-beta5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package main shows how to use a dependency to check if a user is logged in using a special custom Go type `Authenticated`, which when, present on a controller's method or a field then it limits the visibility to "authenticated" users only.

The same result could be done through a middleware as well, however using a static type any person reads your code can see that an "X" controller or method should only be used by "authenticated" users.

Jump to

Keyboard shortcuts

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