This commit is contained in:
Eden Kirin
2023-10-26 00:25:19 +02:00
parent 7024cd0de9
commit da3deedb0c
2 changed files with 12 additions and 1 deletions

View File

@ -11,3 +11,6 @@
- [Source](https://github.com/CloudyKit/jet) - [Source](https://github.com/CloudyKit/jet)
- [Syntax reference](https://github.com/CloudyKit/jet/blob/master/docs/syntax.md) - [Syntax reference](https://github.com/CloudyKit/jet/blob/master/docs/syntax.md)
## Howto
- [Password Hashing (bcrypt)](https://gowebexamples.com/password-hashing/)

View File

@ -1,6 +1,8 @@
package models package models
import "time" import (
"time"
)
type User struct { type User struct {
Id string `gorm:"type(uuid);unique"` Id string `gorm:"type(uuid);unique"`
@ -16,3 +18,9 @@ type User struct {
func (u *User) TableName() string { func (u *User) TableName() string {
return "users" return "users"
} }
// func (u *User) SetPassword(password string) (string, error) {
// secretKey := Config.Application.SecretKey
// bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14)
// return string(bytes), err
// }