auto logout

This commit is contained in:
Sas Andy
2024-12-12 09:53:29 +07:00
parent ecc5dfd9c0
commit 66333ea727
13 changed files with 611 additions and 23 deletions

View File

@@ -1,6 +1,8 @@
package types
import "github.com/markbates/goth"
import (
"github.com/markbates/goth"
)
type OauthStore interface {
AddGoolgeAccount(user UserGoogle) error
@@ -9,6 +11,9 @@ type OauthStore interface {
CompareAuthCode(authcode string, user goth.User, typez string) (int, error)
SignInWestone(email string, password string) (*User, error)
LogSignIn(email string, ip string, status string, tipe string, provider string) error
LogRISLogin(userID int, userAgent string, userName string, message string, status string) error
UpdateUserToken(userID int, token string) error
UpdateExpiredToken(token string) error
}
type UserGoogle struct {
@@ -41,7 +46,7 @@ type GenerateAuthCode struct {
}
type SignInPayload struct {
Email string `json:"email" validate:"required,email"`
Email string `json:"email" validate:"required"`
Password string `json:"password" validate:"required,min=6,max=130"`
}
@@ -55,3 +60,11 @@ type LogLogin struct {
LogLoginIsActive string `db:"Log_LoginIsActive" json:"logLoginIsActive"`
LogLoginLastUpdated string `db:"Log_LoginLastUpdated" json:"logLoginLastUpdated"`
}
type LogRISLogin struct {
LogLoginM_UserID string `db:"Log_LoginM_UserID" json:"LogLoginM_UserID"`
LogLoginDateTime string `db:"Log_LoginDateTime" json:"LogLoginDateTime"`
LogLoginUserAgent string `db:"Log_LoginUserAgent" json:"LogLoginUserAgent"`
LogLoginStatus string `db:"Log_LoginStatus" json:"LogLoginStatus"`
LogLoginUserName string `db:"Log_LoginUserName" json:"LogLoginUserName"`
LogLoginMessage string `db:"Log_LoginMessage" json:"LogLoginMessage"`
}