Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Stuck in loop to /login route #531

Closed
bodanu opened this issue Jul 14, 2020 · 9 comments · Fixed by gnikyt/Basic-Shopify-API#75
Closed

Stuck in loop to /login route #531

bodanu opened this issue Jul 14, 2020 · 9 comments · Fixed by gnikyt/Basic-Shopify-API#75

Comments

@bodanu
Copy link

bodanu commented Jul 14, 2020

image

Expected Behavior

After user/dev installs the app it should redirect to the "home" route if everything checks out.

Current Behavior

App works locally using ngrok as a tunnel, but when uploading to heroku, after instalation, the data is stored in the database, but instead of going to the "home" route, it gets stuck in a loop to the /login route. If I enter the shop name, it returns a 419 code.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Followed each step from the wiki to set everything up
  2. Create new Heroku app
  3. Create procfile for heroku ( web: vendor/bin/heroku-php-apache2 public/ )
  4. Place heroku url and heroku_url/authenticate in the app setup ( app url and whitelist redirect url )
  5. Install the app

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Package Version: v12.0
  • Laravel Version: v7.20
  • PHP Version: v7.4
@gnikyt
Copy link
Owner

gnikyt commented Jul 15, 2020

This is most likely related to the browser cookie issue. Which browser are you using, and does it happen on others?

@bodanu
Copy link
Author

bodanu commented Jul 15, 2020

It is clearly related to cookies. Managed to make it work this morning. Going to retrace every step and post it here later. Maybe it will help.

@gnikyt
Copy link
Owner

gnikyt commented Jul 15, 2020 via email

@helix2020
Copy link

Hi,

I'm having the same issue, even when I clear cookies, it redirects to log in again. Meanwhile, if I write any other route then it seems to work!!

Have you found a solution?

@bodanu
Copy link
Author

bodanu commented Jul 20, 2020

@helix2020 I believe other routes are working, maybe, because they do not use the auth or billable middleware, thus work without cookies, I presume.

So, to retrace the steps:
Most of the info I found is present in #367

  • Installed jenssegers/agent

  • Created this middleware and added it to global middlewares

  • Changes in config/session.php: ( not sure if necessary, but worked right after I did them )
    'path' => '/', to 'path' => '/;SameSite=None; secure', ( not sure if it has any effect with this version of Laravel )
    'secure' => env('SESSION_SECURE_COOKIE'), to 'secure' => env('SESSION_SECURE_COOKIE', true),
    'same_site' => 'lax', to 'same_site' => 'none',

  • Tested on Chrome & Safari and it seems to work. At least for now

App is hosted on heroku

@helix2020
Copy link

Hi @bodanu,

I follow the steps but it doesn't work!!!
Now stuck in the authenticate with the message: 419 Page Expired
As well, It removes the secure URL to insecure. FYI, I'm working in my local server so I'm using ngrok.

@helix2020
Copy link

Hi @osiset,

is this adjustment now in the current version of the package, or should I need to update the package?
Because I'm still having problems with the login and I'm not having access in other routes as well.

Thank you :)

@gnikyt
Copy link
Owner

gnikyt commented Jul 23, 2020

@helix2020 Theres no update right now.

@gnikyt
Copy link
Owner

gnikyt commented Nov 1, 2020

#522

@gnikyt gnikyt closed this as completed Nov 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants