mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-21 05:53:11 -05:00
Fix last_seen update on auth
This commit is contained in:
parent
61b38d5b03
commit
a95bbcb6eb
@ -259,7 +259,7 @@ const touchUser = `-- name: TouchUser :exec
|
|||||||
update
|
update
|
||||||
keibi.users
|
keibi.users
|
||||||
set
|
set
|
||||||
last_used = now()::timestamptz
|
last_seen = now()::timestamptz
|
||||||
where
|
where
|
||||||
pk = $1
|
pk = $1
|
||||||
`
|
`
|
||||||
|
|||||||
@ -47,7 +47,7 @@ limit 1;
|
|||||||
update
|
update
|
||||||
keibi.users
|
keibi.users
|
||||||
set
|
set
|
||||||
last_used = now()::timestamptz
|
last_seen = now()::timestamptz
|
||||||
where
|
where
|
||||||
pk = $1;
|
pk = $1;
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ GET {{host}}/users/me
|
|||||||
Authorization: Bearer {{jwt}}
|
Authorization: Bearer {{jwt}}
|
||||||
HTTP 200
|
HTTP 200
|
||||||
[Captures]
|
[Captures]
|
||||||
register_info: body
|
register_id: jsonpath "$.id"
|
||||||
[Asserts]
|
[Asserts]
|
||||||
jsonpath "$.username" == "login-user"
|
jsonpath "$.username" == "login-user"
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ Authorization: Bearer {{jwt}}
|
|||||||
HTTP 200
|
HTTP 200
|
||||||
[Asserts]
|
[Asserts]
|
||||||
jsonpath "$.username" == "login-user"
|
jsonpath "$.username" == "login-user"
|
||||||
body == {{register_info}}
|
jsonpath "$.id" == {{register_id}}
|
||||||
|
|
||||||
|
|
||||||
# Invalid password login
|
# Invalid password login
|
||||||
|
|||||||
@ -190,6 +190,9 @@ func (h *Handler) GetMe(c echo.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(dbuser) == 0 {
|
||||||
|
return c.JSON(403, "Invalid jwt token, couldn't find user.")
|
||||||
|
}
|
||||||
|
|
||||||
user := MapDbUser(&dbuser[0].User)
|
user := MapDbUser(&dbuser[0].User)
|
||||||
for _, oidc := range dbuser {
|
for _, oidc := range dbuser {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user