Documentation ¶
Index ¶
- Variables
- type ActivateAccountModel
- type AuthAPI
- func (a *AuthAPI) ActivateAccount(params *api.Request) api.Response
- func (a *AuthAPI) ChangePassword(params *api.Request) api.Response
- func (a *AuthAPI) CreateSession(params *api.Request) api.Response
- func (a *AuthAPI) GetAllSessions(params *api.Request) api.Response
- func (a *AuthAPI) KillSession(params *api.Request) api.Response
- func (a *AuthAPI) RequestResetPassword(params *api.Request) api.Response
- func (a *AuthAPI) ResendAccountActivationEmail(params *api.Request) api.Response
- func (a *AuthAPI) ResetPassword(params *api.Request) api.Response
- type AuthModel
- type ChangePasswordModel
- type RequestResetPasswordModel
- type ResendActivationEmailModel
- type ResetPasswordModel
Constants ¶
This section is empty.
Variables ¶
var ( ErrPasswordMatch = errors.New("The passwords do not match") ErrTokenNotSpecified = errors.New("The session token was not specified") )
Errors generated by then Auth endpoint
Functions ¶
This section is empty.
Types ¶
type ActivateAccountModel ¶
type ActivateAccountModel struct {
Token string `json:"token"`
}
ActivateAccountModel is used for activating accounts
type AuthAPI ¶
type AuthAPI int
AuthAPI defines the API endpoint for user authorization
func (*AuthAPI) ActivateAccount ¶
ActivateAccount activates an account using the activation token sent through email
func (*AuthAPI) ChangePassword ¶
ChangePassword changes an user account's password
func (*AuthAPI) CreateSession ¶
CreateSession creates a new session for an existing user account
func (*AuthAPI) GetAllSessions ¶
GetAllSessions retrieves all the sessions for a certain user account
func (*AuthAPI) KillSession ¶
KillSession deletes a session for an existing user account based on the session token
func (*AuthAPI) RequestResetPassword ¶
RequestResetPassword sends an email with a special token that will be used for resetting the password
func (*AuthAPI) ResendAccountActivationEmail ¶
ResendAccountActivationEmail resends the email with the details for activating their user account
type ChangePasswordModel ¶
type ChangePasswordModel struct { Email string `json:"email"` OldPassword string `json:"oldPassword"` Password string `json:"password"` PasswordConfirmation string `json:"passwordConfirmation"` }
ChangePasswordModel is used for changing a user's password
type RequestResetPasswordModel ¶
type RequestResetPasswordModel struct { Email string `json:"email"` PasswordResetServiceLink string `json:"passwordResetServiceLink"` }
RequestResetPasswordModel is used for requesting password resets over email
type ResendActivationEmailModel ¶
type ResendActivationEmailModel struct { Email string `json:"email"` ActivateAccountServiceLink string `json:"activateAccountServiceLink"` }
ResendActivationEmailModel is used for resending the account activation email
type ResetPasswordModel ¶
type ResetPasswordModel struct { Token string `json:"token"` Password string `json:"password"` PasswordConfirmation string `json:"passwordConfirmation"` }
ResetPasswordModel is used for resetting the account password