MCPcopy Index your code
hub / github.com/dnote/dnote / DeleteUserSessions

Method DeleteUserSessions

pkg/server/app/sessions.go:50–56  ·  view source on GitHub ↗

DeleteUserSessions deletes all existing sessions for the given user. It effectively invalidates all existing sessions.

(db *gorm.DB, userID int)

Source from the content-addressed store, hash-verified

48// DeleteUserSessions deletes all existing sessions for the given user. It effectively
49// invalidates all existing sessions.
50func (a *App) DeleteUserSessions(db *gorm.DB, userID int) error {
51 if err := db.Where("user_id = ?", userID).Delete(&database.Session{}).Error; err != nil {
52 return errors.Wrap(err, "deleting sessions")
53 }
54
55 return nil
56}
57
58// DeleteSession deletes the session that match the given info
59func (a *App) DeleteSession(sessionKey string) error {

Callers 1

PasswordResetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected