Documentation ¶
Index ¶
- Constants
- func AccountRegister(usrRepo repo.UserRepoInterface, usr *object.User) (bool, error)
- func AuthenticateUser(usrRepo repo.UserRepoInterface, loginTimeRepo repo.LoginTimeInterface, ...) (bool, error)
- func CertifyOauthAccount(loginTimeRepo repo.LoginTimeInterface, ctx context.Context, account string) int
- func CertifyToken(loginTimeRepo repo.LoginTimeInterface, ctx context.Context, token string) (int, string)
- func CheckExistsID(usrRepo repo.UserRepoInterface, usr *object.User) (bool, error)
- func CreateTable(usrRepo repo.UserRepoInterface) (bool, error)
- func GetUserInfo(client custintfa.Client, accessToken string) (*response.UserInfo, error)
- func Oauth2UpdateLoginTime(userInfo *response.UserInfo, usrRepo repo.UserRepoInterface, ...) error
- func UpdatePassword(usrRepo repo.UserRepoInterface, updatePassword *request.UpdateUserPassword) (bool, error)
Constants ¶
const ( Pass int = iota LoginExpired TokenExpired WrongToken )
Variables ¶
This section is empty.
Functions ¶
func AccountRegister ¶
AccountRegister registers a new user account. It takes a user repository interface and a user object as parameters. It converts the user object to a DAO (Data Access Object) and calls the Register method on the repository. It returns a boolean indicating whether the registration was successful and an error if any.
func AuthenticateUser ¶
func AuthenticateUser(usrRepo repo.UserRepoInterface, loginTimeRepo repo.LoginTimeInterface, usr *object.User) (bool, error)
AuthenticateUser authenticates a user. It takes a user repository interface, a login time repository interface, and a user object as parameters. It retrieves the user's password hash from the repository and compares it with the provided password. If the password is correct, it sets the login time and returns true. If the password is incorrect, it returns false and an error.
func CertifyOauthAccount ¶
func CertifyToken ¶
func CheckExistsID ¶
func CreateTable ¶
func CreateTable(usrRepo repo.UserRepoInterface) (bool, error)
func GetUserInfo ¶
GetUserInfo retrieves user information from the OAuth2 provider.
func Oauth2UpdateLoginTime ¶
func Oauth2UpdateLoginTime(userInfo *response.UserInfo, usrRepo repo.UserRepoInterface, loginTimeRepo repo.LoginTimeInterface) error
func UpdatePassword ¶
func UpdatePassword(usrRepo repo.UserRepoInterface, updatePassword *request.UpdateUserPassword) (bool, error)
Types ¶
This section is empty.