mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: Fix Last Seen being updated on every request (#72036)
* make sure LastSeen hook has information to decide if update is necessary * make user service check if it should update the user's last seen * do not run last seen hook if is a login request * make service return error when last seen is up to date * fix err * Update pkg/services/contexthandler/contexthandler.go Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> * fix golint --------- Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,7 @@ var (
|
||||
ErrLastGrafanaAdmin = errors.New("cannot remove last grafana admin")
|
||||
ErrProtectedUser = errors.New("cannot adopt protected user")
|
||||
ErrNoUniqueID = errors.New("identifying id not found")
|
||||
ErrLastSeenUpToDate = errors.New("last seen is already up to date")
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@@ -95,6 +96,7 @@ type ChangeUserPasswordCommand struct {
|
||||
|
||||
type UpdateUserLastSeenAtCommand struct {
|
||||
UserID int64
|
||||
OrgID int64
|
||||
}
|
||||
|
||||
type SetUsingOrgCommand struct {
|
||||
|
||||
Reference in New Issue
Block a user