我將Laravel Socialiste擴展爲一個新的Oauth提供程序,並且遇到了更改授權URL的簡單問題。覆蓋Laravel RedirectResponse
由RedirectResponse
生成的URL具有%2C
代替+
,例如https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain,對於範圍定界符,因此失敗,我使用的特定提供者,在本例mycustomprovider
。
任何人都知道如何修改此授權網址將%2C
更改爲+
?
return Socialite::driver('mycustomprovider')->redirect();
如果var_dump(Socialite::driver('mycustomprovider')->redirect())
,這裏就是它包含:
RedirectResponse {#886 ▼
#targetUrl: "http://"
+headers: ResponseHeaderBag {#888 ▶}
#content: """
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="UTF-8" />\n
<meta http-equiv="refresh" content="1;url=https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain" />\n
\n
<title>Redirecting to https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain</title>\n
</head>\n
<body>\n
Redirecting to <a href="https://mycustomerprovider.com/oauth/authorize?scope=blah%2Cblahagain</a>.\n
</body>\n
</html>
"""
#version: "1.0"
#statusCode: 302
#statusText: "Found"
#charset: null
}