diff options
Diffstat (limited to 'store/sql_oauth_store.go')
-rw-r--r-- | store/sql_oauth_store.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/store/sql_oauth_store.go b/store/sql_oauth_store.go index 751207b85..688e39b09 100644 --- a/store/sql_oauth_store.go +++ b/store/sql_oauth_store.go @@ -332,3 +332,21 @@ func (as SqlOAuthStore) RemoveAuthData(code string) StoreChannel { return storeChannel } + +func (as SqlOAuthStore) RemoveAuthDataByUserId(userId string) StoreChannel { + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + + _, err := as.GetMaster().Exec("DELETE FROM OAuthAuthData WHERE UserId = :UserId", map[string]interface{}{"UserId": userId}) + if err != nil { + result.Err = model.NewAppError("SqlOAuthStore.RemoveAuthDataByUserId", "We couldn't remove the authorization code", "err="+err.Error()) + } + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} |