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

Pass original_session_id to oauth provider if available (PLATFORM-2978) #15

Closed
wants to merge 2 commits into from

Conversation

joeyAghion
Copy link
Contributor

We'd like the API to be able to associate users' original sessions with backend account activity. This PR introduces support for an optional original_session_id parameter to certain authentication actions. Backend support is being added in https://github.com/artsy/gravity/pull/13895.

(This deserves a test but I couldn't get one to work after struggling for 1+ hours, so submitting this anyway.)

https://artsyproduct.atlassian.net/browse/PLATFORM-2978

@@ -31,6 +31,16 @@ def self.configure
def raw_info
@raw_info ||= access_token.get('/api/current_user', headers: { 'X-ACCESS-TOKEN' => access_token.token }).parsed
end

alias old_request_phase request_phase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL you can do it with an alias. Is it effectively the same as calling super?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure and was following examples for this.

I think they can be a little different. E.g., super might refer to the base class's implementation (OmniAuth::Strategies::OAuth2 in this case), while an alias would refer to whatever self.request_phase resolves to at the time alias is called. Since the Artsy strategy can itself be extended, I thought it was safer to stick with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants