authapi

package
v0.0.0-...-d1a64ea Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (a *AuthAPI) ActivateAccount(params *api.Request) api.Response

ActivateAccount activates an account using the activation token sent through email

func (*AuthAPI) ChangePassword

func (a *AuthAPI) ChangePassword(params *api.Request) api.Response

ChangePassword changes an user account's password

func (*AuthAPI) CreateSession

func (a *AuthAPI) CreateSession(params *api.Request) api.Response

CreateSession creates a new session for an existing user account

func (*AuthAPI) GetAllSessions

func (a *AuthAPI) GetAllSessions(params *api.Request) api.Response

GetAllSessions retrieves all the sessions for a certain user account

func (*AuthAPI) KillSession

func (a *AuthAPI) KillSession(params *api.Request) api.Response

KillSession deletes a session for an existing user account based on the session token

func (*AuthAPI) RequestResetPassword

func (a *AuthAPI) RequestResetPassword(params *api.Request) api.Response

RequestResetPassword sends an email with a special token that will be used for resetting the password

func (*AuthAPI) ResendAccountActivationEmail

func (a *AuthAPI) ResendAccountActivationEmail(params *api.Request) api.Response

ResendAccountActivationEmail resends the email with the details for activating their user account

func (*AuthAPI) ResetPassword

func (a *AuthAPI) ResetPassword(params *api.Request) api.Response

ResetPassword resets an user account's password

type AuthModel

type AuthModel struct {
	AppUserID string `json:"appUserID"`
	Password  string `json:"password"`
}

AuthModel is a binding model used for receiving the authentication data

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

Jump to

Keyboard shortcuts

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