mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
28 lines
No EOL
727 B
Ruby
28 lines
No EOL
727 B
Ruby
module Devise
|
|
module Oauth
|
|
# Provides a few helpers that are included in ActionController::Base
|
|
# for convenience.
|
|
module Helpers
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
helper_method :oauth_callback
|
|
end
|
|
|
|
def oauth_callback #:nodoc:
|
|
nil
|
|
end
|
|
alias :oauth_provider :oauth_callback
|
|
|
|
protected
|
|
|
|
# Overwrite expire_session_data_after_sign_in! so it removes all
|
|
# oauth tokens from session ensuring registrations done in a row
|
|
# do not try to store the same token in the database.
|
|
def expire_session_data_after_sign_in!
|
|
super
|
|
session.keys.grep(/_oauth_token$/).each { |k| session.delete(k) }
|
|
end
|
|
end
|
|
end
|
|
end |