Added login and logout
This commit is contained in:
18
models/session_token.go
Normal file
18
models/session_token.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
type SessionToken struct {
|
||||
BaseModel
|
||||
UserID uint `json:"userId"`
|
||||
Token string `json:"token"`
|
||||
IsActive bool `json:"isActive"`
|
||||
}
|
||||
|
||||
func (SessionToken) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (SessionToken) Create() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (SessionToken) Delete() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
@@ -2,12 +2,13 @@ package models
|
||||
|
||||
type User struct {
|
||||
BaseModel
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Email string `json:"email"`
|
||||
Avatar string `json:"avatar"`
|
||||
IsActive bool `json:"isActive" gorm:"default:false"`
|
||||
CompanyID uint `json:"companyId"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Email string `json:"email"`
|
||||
Avatar string `json:"avatar"`
|
||||
IsActive bool `json:"isActive" gorm:"default:false"`
|
||||
CompanyID uint `json:"companyId"`
|
||||
LoginAttempts int `gorm:"default:0"`
|
||||
}
|
||||
|
||||
type ResetPasswordRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user