auth

package
v0.0.0-...-1c2eb0b Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCookie        = errors.New("user: cookie not found")
	ErrSessionNotFound = errors.New("user: session not found")
	ErrSessionExists   = errors.New("user: session already exists")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	service.Service
	// contains filtered or unexported fields
}

Register a new user

[?] POST /auth/sign-up

Get current account identity

[?] GET /account/me

Delete devices linked to account

[ ] DELETE /account/{uuid}/device

this returns a list of current connections:

[ ] GET /account/{uuid}/devices

Create a cookie

[?] POST /auth/sign-in

Delete a cookie

[?] DELETE /auth/sign-out

Refresh token

[?] GET /auth/refresh

func NewService

func NewService(ctx context.Context, m chi.Router, r user.Repo, tc internal.TokenClient) *Service

type Token

type Token struct {
	IDToken     string `omitempty,json:"idToken"`
	AccessToken string `omitempty,json:"accessToken"`
}

type User

type User struct {
	Email    email.Email       `json:"email"`
	Username string            `json:"username"`
	Password password.Password `json:"password"`
}

Jump to

Keyboard shortcuts

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