twitch_auth

package
v0.0.0-...-edf0be2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	Code  string `json:"code"`
	State string `json:"state"`
}

type Twitch

type Twitch struct {
	Client      *helix.Client
	Streamers   streamer.StreamerRepo
	CookieStore *sessions.CookieStore
}

func (*Twitch) Authenticate

func (t *Twitch) Authenticate(w http.ResponseWriter, r *http.Request) error

func (*Twitch) HandleLogin

func (t *Twitch) HandleLogin(w http.ResponseWriter, r *http.Request) error

HandleLogin is a Handler that redirects the user to Twitch for login, and provides the 'state' parameter which protects against login CSRF.

func (*Twitch) HandleOAuth2Callback

func (t *Twitch) HandleOAuth2Callback(w http.ResponseWriter, r *http.Request) (err error)

HandleOauth2Callback is a Handler for oauth's 'redirect_uri' endpoint; it validates the state token and retrieves an OAuth token from the request parameters.

Jump to

Keyboard shortcuts

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