Skip to content

Adding callback_url option #9

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions lib/omniauth/strategies/bitbucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class Bitbucket < OmniAuth::Strategies::OAuth2
:token_url => 'https://bitbucket.org/site/oauth2/access_token'
}

# Leave this blank to use the redirect_uri you specified in your BitBucket
# OAuth application settings
option :callback_url

# These are called after authentication has succeeded. If
# possible, you should try to set the UID without making
# additional calls (if the user id is returned with the token
Expand All @@ -26,6 +30,10 @@ class Bitbucket < OmniAuth::Strategies::OAuth2
}
end

def callback_url
options[:callback_url]
end

def raw_info
@raw_info ||= begin
ri = MultiJson.decode(access_token.get('/api/1.0/user').body)['user']
Expand Down