statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Token mismatch when auto logging after install #2512

Open kyobul opened 4 years ago

kyobul commented 4 years ago

Describe the bug When you check a fresh install on the UI at /installer, everything is ok until you hit the Create User button. Then you see Logging... which hangs indefinitely.

In JS console I see:

  1. POST https://statamic.test/installer/login 401 (Unauthorized) xhr.js:42
  2. Uncaught (in promise) installer:1 request: method: "POST" data: "{"id":"eb82e04b-1a04-4100-a0e2-ab20726bb3fa"}" params: {} headers: Accept: "application/json, text/plain, /" X-CSRF-TOKEN: "3DenqP0eg84N3Fc33fk6RDb9CmvAbTf7FmUdJafn" X-Requested-With: "XMLHttpRequest" Content-Type: "application/json" proto: Object xhr: null jsonp: "callback" beforeSend: null crossOrigin: false emulateHTTP: false emulateJSON: false timeout: 0 url: "/installer/login" cancel: ƒ () proto: Object data: exception: "TokenMismatchException" redirect: "https://statamic.test/cp/auth/login?expired=1&referer=%2Findex.php%2Finstaller" proto: Object status: 401 statusText: "Unauthorized" headers: ƒ (t) ok: false

To Reproduce Steps to reproduce the behavior:

  1. Go to '/installer'
  2. Click on steps till Create User
  3. See Logging... message
  4. Wait to be redirected... See error in console

Expected behavior To be redirected as logged user

Screenshots If applicable, add screenshots to help explain your problem.

Environment details (please complete the following information):

Additional context I did it a second time, so it created a second user with the same credentials in the background. I don't think this should happen. I can afterwards access the panel at /cp