10
data/user.go
10
data/user.go
@@ -5,13 +5,13 @@ import "github.com/google/uuid"
|
||||
type User struct {
|
||||
Id uint `json:"id" gorm:"primarykey;autoincrement"`
|
||||
UUID uuid.UUID `json:"uuid" gorm:"type:uuid;uniqueindex;not null"`
|
||||
UserId uuid.UUID `json:"user_id" gorm:"size:8;uniqueindex;not null"`
|
||||
UserId uuid.UUID `json:"user_id" gorm:"type:uuid;uniqueindex;not null"`
|
||||
Email string `json:"email" gorm:"uniqueindex;not null"`
|
||||
Nickname string `json:"nickname" gorm:"not null"`
|
||||
Type string `json:"type" gorm:"not null"`
|
||||
Subtitle string `json:"subtitle" gorm:"not null"`
|
||||
Avatar string `json:"avatar" gorm:"not null"`
|
||||
Checkin bool `json:"checkin" gorm:"not null"`
|
||||
Nickname string `json:"nickname"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
Avatar string `json:"avatar"`
|
||||
Checkin bool `json:"checkin" gorm:"not null;default:false"`
|
||||
}
|
||||
|
||||
func (self *User) GetByEmail(email string) error {
|
||||
|
||||
@@ -47,10 +47,9 @@ func RequestMagicLink(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO Send EMail
|
||||
log.Info("Magic link:", link)
|
||||
// TODO send email
|
||||
|
||||
c.JSON(200, gin.H{"message": "magic link sent"})
|
||||
c.JSON(200, gin.H{"message": "magic link sent", "magic_link": link})
|
||||
}
|
||||
|
||||
func VerifyMagicLink(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user