user

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleOauth

func HandleOauth(
	userz core.UserService,
	sessions core.Session,
	notifier core.Notifier,
) http.HandlerFunc

HandleOauth godoc @Summary login with mixin oauth code @Description @Tags user @Accept json @Produce json @Param request body LoginRequest false "request login" @Success 200 {object} LoginResponse @Router /login [post]

Types

type LoginRequest

type LoginRequest struct {
	// mixin oauth code
	Code string `json:"code,omitempty" valid:"required"`
}

type LoginResponse

type LoginResponse struct {
	// user mixin id
	ID string `json:"id,omitempty" format:"uuid"`
	// user name
	Name string `json:"name,omitempty"`
	// user avatar
	Avatar string `json:"avatar,omitempty"`
	// mixin oauth token
	Token string `json:"token,omitempty"`
	// mixin oauth scope
	Scope string `json:"scope,omitempty"`
	// Preferred language
	Language string `json:"language,omitempty"`
}

Jump to

Keyboard shortcuts

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