add user model
This commit is contained in:
parent
5dde43e409
commit
8db61212d9
1 changed files with 17 additions and 0 deletions
17
internal/model/user.go
Normal file
17
internal/model/user.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID string `db:"id"`
|
||||
Email string `db:"email"`
|
||||
// Allow null for passwordless users
|
||||
PasswordHash *string `db:"password_hash"`
|
||||
PendingEmail *string `db:"pending_email"`
|
||||
EmailVerifiedAt *time.Time `db:"email_verified_at"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
func (u *User) HasPassword() bool {
|
||||
return u.PasswordHash != nil && *u.PasswordHash != ""
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue