mdidle ware set
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
)
|
||||
|
||||
var jwtKey = []byte(os.Getenv("SECRET_KEY"))
|
||||
|
||||
type Crenetials struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type Claims struct {
|
||||
jwt.RegisteredClaims
|
||||
Email string `json:"email"`
|
||||
}
|
||||
@@ -8,4 +8,4 @@ type User struct {
|
||||
Email string `json:"email" gorm:"type:string;index"`
|
||||
Password string `json:"password" gorm:"type:string;index"`
|
||||
Phone string `json:"phone" gorm:"type:string;index"`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user