mirror of
https://github.com/hazemKrimi/crimson-vault.git
synced 2026-05-01 18:20:27 +00:00
fix: session authentication middleware
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package types
|
||||
|
||||
type LoginRequestBody struct {
|
||||
Username string `json:"username" validate:"required"`
|
||||
Password string `json:"password" validate:"password"`
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
ID uint32 `json:"id"`
|
||||
ID uint32 `json:"id" gorm:"primaryKey"`
|
||||
CreatedAt time.Time `json:"createAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `json:"deletedAt" gorm:"index"`
|
||||
|
||||
@@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uint32 `json:"id"`
|
||||
ID string `json:"id" gorm:"primaryKey"`
|
||||
SessionID string `json:"-"`
|
||||
CreatedAt time.Time `json:"createAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `json:"deletedAt" gorm:"index"`
|
||||
@@ -19,8 +20,8 @@ type User struct {
|
||||
Country string `json:"country"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username" gorm:"unique"`
|
||||
Password string `json:"-"`
|
||||
}
|
||||
|
||||
type CreateUserRequestBody struct {
|
||||
|
||||
Reference in New Issue
Block a user