Skip to content

Commit

Permalink
Logout Slack user token on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
vurpo committed Aug 1, 2023
1 parent cb748db commit b963030
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ require (
maunium.net/go/mauflag v1.0.0 // indirect
)

replace github.com/slack-go/slack => github.com/beeper/slackgo v0.0.0-20230529112042-04e062c05e8b
replace github.com/slack-go/slack => github.com/beeper/slackgo v0.0.0-20230731145834-b294d2818e10
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/beeper/slackgo v0.0.0-20230529112042-04e062c05e8b h1:SCBqU2C4ka1BZigu025aZGsTL62oJdlQFRWmzE/nWXg=
github.com/beeper/slackgo v0.0.0-20230529112042-04e062c05e8b/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/beeper/slackgo v0.0.0-20230731145834-b294d2818e10 h1:E4pG1V8863lSopZMvzOTBmnbAsnrhKenMWgVaBu3iUw=
github.com/beeper/slackgo v0.0.0-20230731145834-b294d2818e10/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down
4 changes: 4 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ func (user *User) LogoutUserTeam(userTeam *database.UserTeam) error {
}
}

if _, err := userTeam.Client.SendAuthSignout(); err != nil {
user.log.Errorfln("Failed to send auth.signout request to Slack! %v", err)
}

userTeam.Client = nil

user.BridgeStates[userTeam.Key.TeamID].Send(status.BridgeState{StateEvent: status.StateLoggedOut})
Expand Down

0 comments on commit b963030

Please sign in to comment.