-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Call to undefined method App\Models\User::getSessionContext()
in Shopify mobile app
#175
Comments
@adamndev I'm just getting a project set up so I can test this, will come back to you as quick as I can. Octane I could not say, as I've not used it or tested it with the package. |
Thanks @Kyon147, no rush! Also, probably important context I forgot to mention - I have a |
It could be because you are using a Shop model actually, i'd need to take a look and see if we have hardcoded something that could be throwing the error. My apps open fine inside the Shopify app but they are also not on blade, so the process is a bit different for SPAs |
Hi, in auth.php
and my current shopify-app.php
i can see my app install successfully and the shopify user gets populated in the database but it always end up in a Call to undefined method App\Models\User::getSessionContext() error afterward. If there something I am missing? such as middleware or such? |
@adamndev @xiangsgao - can you guys swap back to the default for testing and see if the app loads? |
I have resolved my issue.
The issue is the middleware is still using the original and default laravel auth guard which uses the user model. rather than my own custom model as you can see in line 133
To fix this, I created my own middleware that runs before this
I hope this helps anyone who is facing similar issues. |
For bug reporting only! If you're posting a feature request or discussion, please ignore.
Expected Behavior
Be able to load the app inside of the Shopify mobile app.
Current Behavior
App throws a 500:
Call to undefined method App\Models\User::getSessionContext()
Failure Information
App loads without issue in a browser, but something is going sideways when loading it in an iframe or whatever context is used within Shopify's mobile app.
Initially thought this might be related to
IframeProtection
in some way, but tried the trick from this issue but the error stays the same.I have Octane running, but I also tried disabling it and there was no change there.
Side question, is Octane likely to function ok considering all of the session/token related bits happening behind the scenes?
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
Please include any relevant log snippets or files here.
The text was updated successfully, but these errors were encountered: