Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrWrap = "auth-controller: %w" ErrNoClaim = errors.New("no claim data") )
Error messages.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
controller.Base
}
Controller is a predefined auth controller.
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) 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.