Readme
This commit is contained in:
@ -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/)
|
||||||
|
|||||||
@ -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
|
||||||
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user