controller

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrap    = "auth-controller: %w"
	ErrNoClaim = errors.New("no claim data")
)

Error messages.

Functions

func AddRoutes

func AddRoutes(r router.Manager) error

AddRoutes is a helper to register all defined auth routes for the auth controller.

Types

type Auth

type Auth struct {
	controller.Base
}

Controller is a predefined auth controller.

func (*Auth) Accounts

func (c *Auth) Accounts()

Accounts

func (*Auth) ChangePassword

func (c *Auth) ChangePassword()

ChangePassword will call the providers function.

func (*Auth) ForgotPassword

func (c *Auth) ForgotPassword()

ForgotPassword will call the providers function.

func (*Auth) Login

func (c *Auth) Login()

Login will check: - if the provider is defined and allowed. - call the providers Login function. - generate the jwt token. - return the user claim.

func (*Auth) Logout

func (c *Auth) Logout()

Logout will delete the browser cookies and deleted the refresh token. if the token was refreshed, its taken care of because the new refresh token gets set as request.

func (*Auth) Nav

func (c *Auth) Nav()

Nav configures the frontend vue navigation. BUG: Set Title on RouteID will fuck up the BelongsTo Select TODO: Simplyfy the Route.Pattern, also change the belongsTo logic?

func (*Auth) Navigation

func (c *Auth) Navigation()

Navigation fetches all endpoints by the user roles and sets the response data.

func (*Auth) Roles

func (c *Auth) Roles()

func (*Auth) Routes

func (c *Auth) Routes()

Routes are displayed. The backend routes are added automatically. Frontend routes must be defined. TODO atm frontend routes have to get defined in vue and in go. In the future the added frontend routes should be passed to the frontend. TODO i have to think about a solution because of the vue.components because they are locally registered which is the main problem.

Jump to

Keyboard shortcuts

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