auth

package module
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: AGPL-3.0 Imports: 0 Imported by: 1

README

auth

Progetto che permette agli studenti di accedere ai servizi di CartaBinaria collegando il proprio account Github.

Usage

Run tool with:

go run cmd/auth.go

Generate swagger.json with:

swag init -g cmd/auth.go
swag fmt

To login, in your browser go to:

http://localhost:3000/login?redirect_uri=http://localhost:3000/whoami

A cookie named auth should be set, and then to logout:

http://localhost:3000/logout?redirect_uri=http://localhost:3000/whoami

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role added in v0.3.7

type Role string
const (
	RoleAdmin  Role = "admin"
	RoleMember Role = "member"
	RoleUser   Role = "user"
)

type User

type User struct {
	ID        uint   `json:"id"`
	Username  string `json:"username"`
	AvatarUrl string `json:"avatarUrl"`
	Name      string `json:"name"`
	Email     string `json:"email"`
	Role      Role   `json:"role"`
}

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
pkg

Jump to

Keyboard shortcuts

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