oauth

package
v0.0.0-...-26f6338 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth

type OAuth struct {
	RouterPath   string
	APIDomain    string
	EnforceHTTPS bool
	Providers    map[string]*structs.Provider
	ServerURL    string
	Routes       func(fiber.Router)
	Auth         *authorization.Auth
	DB           *database.Database
}

func New

func New(router_path string, server_url string, enforce_https bool, api_domain string, server_secret string, db *database.Database) *OAuth

func (*OAuth) CreateSession

func (s *OAuth) CreateSession(c *fiber.Ctx, user *types.User, identity_provider string, session_expiry time.Time) error

func (*OAuth) Discord

func (s *OAuth) Discord(client_id string, client_secret string)

func (*OAuth) GitHub

func (s *OAuth) GitHub(client_id string, client_secret string)

func (*OAuth) Google

func (s *OAuth) Google(client_id string, client_secret string)

func (*OAuth) SetCookie

func (s *OAuth) SetCookie(user *types.User, session_id string, identity_provider string, expiration time.Time, c *fiber.Ctx)

Jump to

Keyboard shortcuts

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