{"modulePath":"github.com/RedAFD/code-core","version":"v1.8.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package user\n\n## Constants\n\n```go\nconst (\n\t// AccessTokenErrorCodeInvalidRequest represents an error code specified in RFC 6749\n\tAccessTokenErrorCodeInvalidRequest AccessTokenErrorCode = \"invalid_request\"\n\t// AccessTokenErrorCodeInvalidClient represents an error code specified in RFC 6749\n\tAccessTokenErrorCodeInvalidClient = \"invalid_client\"\n\t// AccessTokenErrorCodeInvalidGrant represents an error code specified in RFC 6749\n\tAccessTokenErrorCodeInvalidGrant = \"invalid_grant\"\n\t// AccessTokenErrorCodeUnauthorizedClient represents an error code specified in RFC 6749\n\tAccessTokenErrorCodeUnauthorizedClient = \"unauthorized_client\"\n\t// AccessTokenErrorCodeUnsupportedGrantType represents an error code specified in RFC 6749\n\tAccessTokenErrorCodeUnsupportedGrantType = \"unsupported_grant_type\"\n\t// AccessTokenErrorCodeInvalidScope represents an error code specified in RFC 6749\n\tAccessTokenErrorCodeInvalidScope = \"invalid_scope\"\n)\n```\n\n```go\nconst (\n\n\t// TplActivate template path for activate user\n\tTplActivate base.TplName = \"user/auth/activate\"\n)\n```\n\n## Functions\n\n```go\nfunc AccessTokenOAuth(ctx *context.Context, form auth.AccessTokenForm)\n```\nAccessTokenOAuth manages all access token requests by the client\n\n```go\nfunc Action(ctx *context.Context)\n```\nAction response for follow/unfollow user request\n\n```go\nfunc Activate(ctx *context.Context)\n```\nActivate render activate user page\n\n```go\nfunc ActivateEmail(ctx *context.Context)\n```\nActivateEmail render the activate email page\n\n```go\nfunc AuthorizeOAuth(ctx *context.Context, form auth.AuthorizationForm)\n```\nAuthorizeOAuth manages authorize requests\n\n```go\nfunc AutoSignIn(ctx *context.Context) (bool, error)\n```\nAutoSignIn reads cookie and try to auto-login.\n\n```go\nfunc ConnectOpenID(ctx *context.Context)\n```\nConnectOpenID shows a form to connect an OpenID URI to an existing account\n\n```go\nfunc ConnectOpenIDPost(ctx *context.Context, form auth.ConnectOpenIDForm)\n```\nConnectOpenIDPost handles submission of a form to connect an OpenID URI to an existing account\n\n```go\nfunc Dashboard(ctx *context.Context)\n```\nDashboard render the dashborad page\n\n```go\nfunc Email2User(ctx *context.Context)\n```\nEmail2User show user page via email\n\n```go\nfunc Followers(ctx *context.Context)\n```\nFollowers render user's followers page\n\n```go\nfunc Following(ctx *context.Context)\n```\nFollowing render user's followering page\n\n```go\nfunc ForgotPasswd(ctx *context.Context)\n```\nForgotPasswd render the forget pasword page\n\n```go\nfunc ForgotPasswdPost(ctx *context.Context)\n```\nForgotPasswdPost response for forget password request\n\n```go\nfunc GetNotificationCount(c *context.Context)\n```\nGetNotificationCount is the middleware that sets the notification count in the context\n\n```go\nfunc GetUserByName(ctx *context.Context, name string) *models.User\n```\nGetUserByName get user by name\n\n```go\nfunc GetUserByParams(ctx *context.Context) *models.User\n```\nGetUserByParams returns user whose name is presented in URL paramenter.\n\n```go\nfunc GrantApplicationOAuth(ctx *context.Context, form auth.GrantApplicationForm)\n```\nGrantApplicationOAuth manages the post request submitted when a user grants access to an application\n\n```go\nfunc Issues(ctx *context.Context)\n```\nIssues render the user issues page\n\n```go\nfunc LinkAccount(ctx *context.Context)\n```\nLinkAccount shows the page where the user can decide to login or create a new account\n\n```go\nfunc LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterForm)\n```\nLinkAccountPostRegister handle the creation of a new account for an external account using signUp\n\n```go\nfunc LinkAccountPostSignIn(ctx *context.Context, signInForm auth.SignInForm)\n```\nLinkAccountPostSignIn handle the coupling of external account with another account using signIn\n\n```go\nfunc MustChangePassword(ctx *context.Context)\n```\nMustChangePassword renders the page to change a user's password\n\n```go\nfunc MustChangePasswordPost(ctx *context.Context, cpt *captcha.Captcha, form auth.MustChangePasswordForm)\n```\nMustChangePasswordPost response for updating a user's password after his/her account was created by an admin\n\n```go\nfunc NotificationPurgePost(c *context.Context)\n```\nNotificationPurgePost is a route for 'purging' the list of notifications - marking all unread as read\n\n```go\nfunc NotificationStatusPost(c *context.Context)\n```\nNotificationStatusPost is a route for changing the status of a notification\n\n```go\nfunc Notifications(c *context.Context)\n```\nNotifications is the notifications page\n\n```go\nfunc Profile(ctx *context.Context)\n```\nProfile render user's profile page\n\n```go\nfunc RegisterOpenID(ctx *context.Context)\n```\nRegisterOpenID shows a form to create a new user authenticated via an OpenID URI\n\n```go\nfunc RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.SignUpOpenIDForm)\n```\nRegisterOpenIDPost handles submission of a form to create a new user authenticated via an OpenID URI\n\n```go\nfunc ResetPasswd(ctx *context.Context)\n```\nResetPasswd render the reset password page\n\n```go\nfunc ResetPasswdPost(ctx *context.Context)\n```\nResetPasswdPost response from reset password request\n\n```go\nfunc ShowSSHKeys(ctx *context.Context, uid int64)\n```\nShowSSHKeys output all the ssh keys of user by uid\n\n```go\nfunc SignIn(ctx *context.Context)\n```\nSignIn render sign in page\n\n```go\nfunc SignInOAuth(ctx *context.Context)\n```\nSignInOAuth handles the OAuth2 login buttons\n\n```go\nfunc SignInOAuthCallback(ctx *context.Context)\n```\nSignInOAuthCallback handles the callback from the given provider\n\n```go\nfunc SignInOpenID(ctx *context.Context)\n```\nSignInOpenID render sign in page\n\n```go\nfunc SignInOpenIDPost(ctx *context.Context, form auth.SignInOpenIDForm)\n```\nSignInOpenIDPost response for openid sign in request\n\n```go\nfunc SignInPost(ctx *context.Context, form auth.SignInForm)\n```\nSignInPost response for sign in request\n\n```go\nfunc SignOut(ctx *context.Context)\n```\nSignOut sign out from login status\n\n```go\nfunc SignUp(ctx *context.Context)\n```\nSignUp render the register page\n\n```go\nfunc SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterForm)\n```\nSignUpPost response for sign up information submission\n\n```go\nfunc TwoFactor(ctx *context.Context)\n```\nTwoFactor shows the user a two-factor authentication page.\n\n```go\nfunc TwoFactorPost(ctx *context.Context, form auth.TwoFactorAuthForm)\n```\nTwoFactorPost validates a user's two-factor authentication token.\n\n```go\nfunc TwoFactorScratch(ctx *context.Context)\n```\nTwoFactorScratch shows the scratch code form for two-factor authentication.\n\n```go\nfunc TwoFactorScratchPost(ctx *context.Context, form auth.TwoFactorScratchAuthForm)\n```\nTwoFactorScratchPost validates and invalidates a user's two-factor scratch token.\n\n```go\nfunc U2F(ctx *context.Context)\n```\nU2F shows the U2F login page\n\n```go\nfunc U2FChallenge(ctx *context.Context)\n```\nU2FChallenge submits a sign challenge to the browser\n\n```go\nfunc U2FSign(ctx *context.Context, signResp u2f.SignResponse)\n```\nU2FSign authenticates the user by signResp\n\n## Types\n\n```go\ntype AccessTokenError struct {\n\tErrorCode        AccessTokenErrorCode `json:\"error\" form:\"error\"`\n\tErrorDescription string               `json:\"error_description\"`\n}\n```\nAccessTokenError represents an error response specified in RFC 6749\n\n```go\nfunc (err AccessTokenError) Error() string\n```\nError returns the error message\n\n```go\ntype AccessTokenErrorCode string\n```\nAccessTokenErrorCode represents an error code specified in RFC 6749\n\n```go\ntype AccessTokenResponse struct {\n\tAccessToken  string    `json:\"access_token\"`\n\tTokenType    TokenType `json:\"token_type\"`\n\tExpiresIn    int64     `json:\"expires_in\"`\n\tRefreshToken string    `json:\"refresh_token\"`\n}\n```\nAccessTokenResponse represents a successful access token response\n\n```go\ntype AuthorizeError struct {\n\tErrorCode        AuthorizeErrorCode `json:\"error\" form:\"error\"`\n\tErrorDescription string\n\tState            string\n}\n```\nAuthorizeError represents an error type specified in RFC 6749\n\n```go\nfunc (err AuthorizeError) Error() string\n```\nError returns the error message\n\n```go\ntype AuthorizeErrorCode string\n```\nAuthorizeErrorCode represents an error code specified in RFC 6749\n\n```go\nconst (\n\t// ErrorCodeInvalidRequest represents the according error in RFC 6749\n\tErrorCodeInvalidRequest AuthorizeErrorCode = \"invalid_request\"\n\t// ErrorCodeUnauthorizedClient represents the according error in RFC 6749\n\tErrorCodeUnauthorizedClient AuthorizeErrorCode = \"unauthorized_client\"\n\t// ErrorCodeAccessDenied represents the according error in RFC 6749\n\tErrorCodeAccessDenied AuthorizeErrorCode = \"access_denied\"\n\t// ErrorCodeUnsupportedResponseType represents the according error in RFC 6749\n\tErrorCodeUnsupportedResponseType AuthorizeErrorCode = \"unsupported_response_type\"\n\t// ErrorCodeInvalidScope represents the according error in RFC 6749\n\tErrorCodeInvalidScope AuthorizeErrorCode = \"invalid_scope\"\n\t// ErrorCodeServerError represents the according error in RFC 6749\n\tErrorCodeServerError AuthorizeErrorCode = \"server_error\"\n\t// ErrorCodeTemporaryUnavailable represents the according error in RFC 6749\n\tErrorCodeTemporaryUnavailable AuthorizeErrorCode = \"temporarily_unavailable\"\n)\n```\n\n```go\ntype TokenType string\n```\nTokenType specifies the kind of token\n\n```go\nconst (\n\t// TokenTypeBearer represents a token type specified in RFC 6749\n\tTokenTypeBearer TokenType = \"bearer\"\n\t// TokenTypeMAC represents a token type specified in RFC 6749\n\tTokenTypeMAC = \"mac\"\n)\n```\n\n","path":"github.com/RedAFD/code-core/routers/user","name":"user","synopsis":"","isRedistributable":true}
