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

finalize view: pass shop param to login if avaliable #3

Closed
wants to merge 1 commit into from

Conversation

mrk-its
Copy link

@mrk-its mrk-its commented Jan 5, 2015

When Embedded App SDK is used and user opens application first time from admin panel login page is displayed in frame. This simple patch fixes it for us.

@mrk-its mrk-its closed this Jan 5, 2015
@mrk-its mrk-its reopened this Jan 5, 2015
@gavinballard
Copy link
Member

Thanks @mrk-its! I'll have a look at this ASAP and get it merged. 👍

@gavinballard gavinballard self-assigned this Jan 6, 2015
@gavinballard
Copy link
Member

Hey @mrk-its, thanks again for taking the time to submit this PR.

I'm a little confused about the behaviour of this patch, so maybe you can help me out a bit. The redirect to the login URL you've added is only taking place when the finalize call has failed to extract an API token during the OAuth flow - this shouldn't be happening in the normal flow of events.

The changes I made in this commit will automatically handle the passing of Shopify's authentication parameters (shop, timestamp, and signature) to the start of the login flow for any view wrapped in the @login_required decorator that's accessed without a logged in user. Shopify passes all of these parameters with every request, so if you're trying to access a login-protected part of your app from within the Admin (say, /dashboard), there should be an automatic redirection to the login page (with the authentication parameters intact), which will go through the login flow and finally return you to /dashboard.

Hopefully that all made sense - perhaps I'm just not quite understanding the issue you were having. If you could provide more detail, that would be great!

Thanks!

@mrk-its
Copy link
Author

mrk-its commented Jan 8, 2015

Hey.

I've checked things on our side again and it turned out that this issue was caused by invalid application callback URL (it was set to finalize view) - after change to application main view everything works as expected :)

Thanks for fast reply - it was very helpful.

@mrk-its mrk-its closed this Jan 8, 2015
@mrk-its
Copy link
Author

mrk-its commented Jan 8, 2015

@gavinballard
Copy link
Member

Great, glad that works @mrk-its :).

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