Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletes the current access token from accounts before resetting session #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/applicaster/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def user_data_from_omniauth(omniauth_credentials)
access_token(omniauth_credentials).get("/api/v1/users/current.json").parsed
end

def delete_session_for_token(token)
connection(token: token).delete("/api/v1/sessions/0.json")
end

def accounts
self.class.accounts_from_token(client_credentials_token.token)
end
Expand Down
1 change: 1 addition & 0 deletions lib/applicaster/sessions_controller_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def create
end

def destroy
Applicaster::Accounts.new.delete_session_for_token(current_access_token)
reset_session

redirect_to "/"
Expand Down
2 changes: 1 addition & 1 deletion lib/omniauth-applicaster/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module OmniAuth
module Applicaster
VERSION = "1.7.1"
VERSION = "1.7.2"
end
end