___ __ _ _ _ _ _
/ _ \ / _` || | | || |_ | |__
| (_) | (_| || |_| || __|| '_ \
\___/ \__,_| \__,_| \__||_| |_|
import "github.com/agentstation/oauth"
- Variables
- func Begin(e echo.Context) error
- func GetSession(e echo.Context, key string) (string, error)
- func Logout(e echo.Context) error
- func ProviderURL(e echo.Context) (string, error)
- func SetProviders(providers ...goth.Provider)
- func SetSession(e echo.Context, key string, value string) error
- func SetStore(store sessions.Store)
- func Store() sessions.Store
- type User
var (
// GetState gets the state from the oauth session.
GetState = egothic.GetState
// SetState sets the state in the oauth session.
SetState = egothic.SetState
// GetProviderName gets the provider name from the oauth session.
GetProviderName = egothic.GetProviderName
)
func Begin
func Begin(e echo.Context) error
Begin starts the authentication process for a given provider.
func GetSession
func GetSession(e echo.Context, key string) (string, error)
GetSession retrieves a value from the session by key. It returns an error if the key doesn't exist.
func Logout
func Logout(e echo.Context) error
Logout invalidates a user session.
func ProviderURL
func ProviderURL(e echo.Context) (string, error)
ProviderURL returns the authentication URL for the specified provider.
func SetProviders
func SetProviders(providers ...goth.Provider)
SetProviders sets the goth oauth providers.
You can find the list of supported providers here: https://github.com/markbates/goth?tab=readme-ov-file#supported-providers
func SetSession
func SetSession(e echo.Context, key string, value string) error
SetSession stores a key/value pair in the session.
func SetStore
func SetStore(store sessions.Store)
SetStore sets the store for the oauth session.
func Store
func Store() sessions.Store
Store returns the store for the oauth session.
type User
User represents an oauth user that has authenticated.
type User struct {
RawData map[string]interface{}
Provider string
Email string
Name string
FirstName string
LastName string
NickName string
Description string
UserID string
AvatarURL string
Location string
AccessToken string
AccessTokenSecret string
RefreshToken string
ExpiresAt time.Time
IDToken string
}
func Complete
func Complete(e echo.Context) (User, error)
Complete completes the authentication process and returns the user.
func (*User) Validate
func (u *User) Validate() error
Validate validates the user
Generated by gomarkdoc