Closed 0xACCE55 closed 2 years ago
I was being a potato and going directly to the /auth/passport URL in the browser. Ima close this one off.
I wish opening /auth/passport would be supported. I don't want the user to have to click login...
It's possible with this tweak:
# Replace '<script>window.close(); window.opener.app.authenticationComplete(%s);</script>',
# With '<script>if (window.opener){window.close(); window.opener.app.authenticationComplete(%s);}else{location.href="/"}</script>',
# In /flarum/app/vendor/flarum/core/src/Forum/Auth/ResponseFactory.php
RUN sed -i 's/<script>window.close(); window.opener.app.authenticationComplete(%s);<\/script>/<script>if (window.opener){window.close(); window.opener.app.authenticationComplete(%s);}else{location.href="\/"}</g' /flarum/app/vendor/flarum/core/src/Forum/Auth/ResponseFactory.php
Bug Report
Current Behavior After completing the OAuth flow and the 'code' param is returned when redirected to the redirect url, i.e /auth/passport?code=
A blank page is returned with the below error in the console
Which is referring to this part of the code
<script>window.close(); window.opener.app.authenticationComplete({"email":"{email was here}","token":"{token was here}","provided":["email"]});</script>
Environment