Exemplo n.º 1
0
// create a time limit code for user reset password
func CreateUserResetPwdCode(user *User, startInf interface{}) string {
	days := utils.ResetPwdCodeLives
	data := utils.ToStr(user.Id) + user.Email + user.UserName + user.Password + user.Rands + user.Updated.String()
	return utils.CreateTimeLimitCode(data, days, startInf)
}
Exemplo n.º 2
0
// create a time limit code for user active
func CreateUserActiveCode(user *User, startInf interface{}) string {
	days := utils.ActiveCodeLives
	data := utils.ToStr(user.Id) + user.Email + user.UserName + user.Password + user.Rands
	return utils.CreateTimeLimitCode(data, days, startInf)
}
Exemplo n.º 3
0
// verify code when reset password
func VerifyUserResetPwdCode(user *User, code string) bool {
	days := utils.ResetPwdCodeLives
	data := utils.ToStr(user.Id) + user.Email + user.UserName + user.Password + user.Rands + user.Updated.String()
	return utils.VerifyTimeLimitCode(data, days, code)
}
Exemplo n.º 4
0
// verify active code when active account
func VerifyUserActiveCode(user *User, code string) bool {
	days := utils.ActiveCodeLives
	data := utils.ToStr(user.Id) + user.Email + user.UserName + user.Password + user.Rands
	return utils.VerifyTimeLimitCode(data, days, code)
}