handlers

package
v0.0.0-...-b4a6059 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPAResponseType = "spa"
	SSRResponseType = "ssr"
)
View Source
const UpdateAllType = 0
View Source
const UpdateGeneralType = 1
View Source
const UpdateSocialInfoType = 2

Variables

View Source
var NotFoundHTTPStatusError = errors.New("NotFoundHTTPStatusError")

Functions

func AdminSignupHandle

func AdminSignupHandle(c *fiber.Ctx) error

AdminSignupHandle verify signup token

func ChangePasswordHandler

func ChangePasswordHandler(c *fiber.Ctx) error

ChangePasswordHandler creates a handler for logging in

func CheckAdminHandler

func CheckAdminHandler(c *fiber.Ctx) error

CheckAdminHandler creates a handler to check whether admin user registered

func ForgetPasswordFormHandler

func ForgetPasswordFormHandler(c *fiber.Ctx) error

ForgetPasswordFormHandler

func ForgetPasswordPageHandler

func ForgetPasswordPageHandler(c *fiber.Ctx) error

ForgetPasswordPageHandler creates a handler for logging in

func Login2Handle

func Login2Handle(c *fiber.Ctx) error

Login2Handle creates a handler for logging in telar social

func LoginAdminHandler

func LoginAdminHandler(c *fiber.Ctx) error

LoginAdminHandler creates a handler for logging in telar social

func LoginGithubHandler

func LoginGithubHandler(c *fiber.Ctx) error

LoginGithubHandler creates a handler for logging in github

func LoginGoogleHandler

func LoginGoogleHandler(c *fiber.Ctx) error

LoginGoogleHandler makes a handler for OAuth 2.0 redirects

func LoginPageHandler

func LoginPageHandler(c *fiber.Ctx) error

LoginPageHandler creates a handler for logging in

func LoginTelarHandler

func LoginTelarHandler(c *fiber.Ctx) error

LoginTelarHandler creates a handler for logging in telar social

func LoginTelarHandlerSPA

func LoginTelarHandlerSPA(c *fiber.Ctx, model *models.LoginModel) error

LoginTelarHandlerSPA creates a handler for logging in telar social

func LoginTelarHandlerSSR

func LoginTelarHandlerSSR(c *fiber.Ctx, model *models.LoginModel) error

LoginTelarHandlerSSR creates a handler for logging in telar social

func OAuth2Handler

func OAuth2Handler(c *fiber.Ctx) error

OAuth2Handler makes a handler for OAuth 2.0 redirects

func PrintClaim

func PrintClaim(claims jwt.MapClaims)

func ResetPasswordFormHandler

func ResetPasswordFormHandler(c *fiber.Ctx) error

ResetPasswordFormHandler creates a handler for logging in

func ResetPasswordPageHandler

func ResetPasswordPageHandler(c *fiber.Ctx) error

ResetPasswordPageHandler creates a handler for logging in

func Signup2Handle

func Signup2Handle(c *fiber.Ctx) error

func SignupPageHandler

func SignupPageHandler(c *fiber.Ctx) error

SignupPageHandler creates a handler for logging in

func SignupTokenHandle

func SignupTokenHandle(c *fiber.Ctx) error

SignupTokenHandle create signup token

func UnixToTime

func UnixToTime(epoch float64) string

func UpdateProfileHandle

func UpdateProfileHandle(c *fiber.Ctx) error

UpdateProfileHandle a function invocation

func VerifySignupHandle

func VerifySignupHandle(c *fiber.Ctx) error

VerifySignupHandle verify signup token

func VerifySignupSPA

func VerifySignupSPA(c *fiber.Ctx, model *models.VerifySignupModel) error

func VerifySignupSSR

func VerifySignupSSR(c *fiber.Ctx, model *models.VerifySignupModel) error

Types

type CreateActionRoomModel

type CreateActionRoomModel struct {
	ObjectId    uuid.UUID `json:"objectId"`
	OwnerUserId uuid.UUID `json:"ownerUserId"`
	PrivateKey  string    `json:"privateKey"`
	AccessKey   string    `json:"accessKey"`
	Status      int       `json:"status"`
	CreatedDate int64     `json:"created_date"`
}

type Organization

type Organization struct {
	Login string `json:"login"`
}

type ProfileResultAsync

type ProfileResultAsync struct {
	Profile *models.UserProfileModel
	Error   error
}

type ProviderAccessToken

type ProviderAccessToken struct {
	AccessToken string `json:"access_token"`
}

ProviderAccessToken as issued by GitHub or GitLab

type ResetPasswordClaims

type ResetPasswordClaims struct {
	VerifyId string `json:"verifyId"`
	jwt.StandardClaims
}

type TelarSocailClaims

type TelarSocailClaims struct {
	// Name is the full name of the user for OIDC
	Name string `json:"name"`

	// AccessToken for use with the GitHub Profile API
	AccessToken string `json:"access_token"`

	// String with all organizations separated with commas
	Organizations string `json:"organizations"`

	// User information
	Claim UserClaim `json:"claim"`

	// Inherit from standard claims
	jwt.StandardClaims
}

TelarSocailClaims extends standard claims

type TokenModel

type TokenModel struct {
	// contains filtered or unexported fields
}

type UpdateProfileQueryModel

type UpdateProfileQueryModel struct {
	UpdateType int `query:"updateType"`
}

type User

type User struct {
	// contains filtered or unexported fields
}

type UserClaim

type UserClaim struct {
	DisplayName   string `json:"displayName"`
	SocialName    string `json:"socialName"`
	Organizations string `json:"organizations"`
	Avatar        string `json:"avatar"`
	Banner        string `json:"banner"`
	TagLine       string `json:"tagLine"`
	UserId        string `json:"uid"`
	Email         string `json:"email"`
	CreatedDate   int64  `json:"createdDate"`
	Role          string `json:"role"`
}

User information claim

type UserInfoInReq

type UserInfoInReq struct {
	UserId      uuid.UUID `json:"userId"`
	Username    string    `json:"username"`
	Avatar      string    `json:"avatar"`
	DisplayName string    `json:"displayName"`
	SystemRole  string    `json:"systemRole"`
}

type UsersLangSettingsResultAsync

type UsersLangSettingsResultAsync struct {
	Error error
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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