TouchLastLoginAt updates the last login timestamp
(user database.User, tx *gorm.DB)
| 37 | |
| 38 | // TouchLastLoginAt updates the last login timestamp |
| 39 | func (a *App) TouchLastLoginAt(user database.User, tx *gorm.DB) error { |
| 40 | t := a.Clock.Now() |
| 41 | if err := tx.Model(&user).Update("last_login_at", &t).Error; err != nil { |
| 42 | return pkgErrors.Wrap(err, "updating last_login_at") |
| 43 | } |
| 44 | |
| 45 | return nil |
| 46 | } |
| 47 | |
| 48 | // CreateUser creates a user |
| 49 | func (a *App) CreateUser(email, password string, passwordConfirmation string) (database.User, error) { |
no test coverage detected