<p></p>
<p>I've seen some issues with a user having to log in first at the rails port and then follow a redirect back to discourse (example: <a href="http://railsport.internal/login?referer=http://discourse.internal/auth/oauth2_basic/callback" rel="nofollow">http://railsport.internal/login?referer=http://discourse.internal/auth/oauth2_basic/callback</a>).</p>
<p><code>safe_referer</code> in the app controller sanitises the referer url so that the redirect no longer works. When commenting out all that logic, discourse reports an csrf_detected error...</p>
<p>Long story short, I believe it would make sense to somehow include discourse in the tests. They offer a container image which is good enough for testing. <a href="https://hub.docker.com/r/bitnami/discourse/" rel="nofollow">https://hub.docker.com/r/bitnami/discourse/</a></p>
<p>Inside the discourse container, the oauth2-basic plugin needs to be installed:</p>
<p>git clone <a href="https://github.com/discourse/discourse-oauth2-basic.git">https://github.com/discourse/discourse-oauth2-basic.git</a> /opt/bitnami/discourse/plugins/discourse-oauth2-basic<br>
chown -R discourse:discourse /opt/bitnami/discourse/plugins/discourse-oauth2-basic</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/1408#issuecomment-708023884">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLIWGY2HWI2EERUIIUDSKTCGNANCNFSM4C3VTPOA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLKQTKWYST4XZQU56QDSKTCGNA5CNFSM4C3VTPOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFIZZMTA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/1408#issuecomment-708023884",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/1408#issuecomment-708023884",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>