direct

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredChecker

type CredChecker func(email, password string) error

type Provider

type Provider struct {
	AuthURL string
	UserFetcher
	CredChecker
	// contains filtered or unexported fields
}

func New

func New(authUrl string, userFetcher UserFetcher, credChecker CredChecker) *Provider

func (*Provider) BeginAuth

func (p *Provider) BeginAuth(state string) (goth.Session, error)

func (*Provider) Debug

func (p *Provider) Debug(debug bool)

func (*Provider) FetchUser

func (p *Provider) FetchUser(session goth.Session) (goth.User, error)

func (*Provider) IssueSession

func (p *Provider) IssueSession(email, password string) (goth.Session, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) RefreshToken

func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error)

func (*Provider) RefreshTokenAvailable

func (p *Provider) RefreshTokenAvailable() bool

func (*Provider) SetName

func (p *Provider) SetName(name string)

func (*Provider) UnmarshalSession

func (p *Provider) UnmarshalSession(data string) (goth.Session, error)

type Session

type Session struct {
	AuthURL string
	Email   string
}

func (*Session) Authorize

func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error)

func (*Session) GetAuthURL

func (s *Session) GetAuthURL() (string, error)

func (*Session) Marshal

func (s *Session) Marshal() string

type UserFetcher

type UserFetcher func(email string) (goth.User, error)

Jump to

Keyboard shortcuts

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