We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 121a3e4 commit ca8f821Copy full SHA for ca8f821
app/users/repository/logout_users.go
@@ -2,18 +2,13 @@ package repository
2
3
import (
4
"context"
5
- "github.com/hammer-code/lms-be/domain"
6
"time"
+
7
+ "github.com/hammer-code/lms-be/domain"
8
)
9
10
func (repo *repository) LogoutUser(ctx context.Context, token string, expiredAt time.Time) error {
- err := repo.db.DB(ctx).Create(&domain.LogoutToken{
11
- Token: token,
12
- ExpiredAt: expiredAt,
13
- CreatedAt: time.Now(),
14
- }).Error
15
-
16
- if err != nil {
+ if err := repo.db.DB(ctx).Model(&domain.LogoutToken{}).Where("token = ?", token).Update("status", 0).Error; err != nil {
17
return err
18
}
19
0 commit comments