mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 16:41:54 +08:00
refactor(auth): Update OAuth URLs and button text for CZL Connect integration
This commit is contained in:
parent
4af1592021
commit
3810153f8e
@ -155,7 +155,7 @@ func (h *ProxyHandler) LoginHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
clientID := os.Getenv("OAUTH_CLIENT_ID")
|
clientID := os.Getenv("OAUTH_CLIENT_ID")
|
||||||
redirectURI := getCallbackURL(r)
|
redirectURI := getCallbackURL(r)
|
||||||
|
|
||||||
authURL := fmt.Sprintf("https://connect.q58.club/oauth/authorize?%s",
|
authURL := fmt.Sprintf("https://connect.czl.net/oauth2/authorize?%s",
|
||||||
url.Values{
|
url.Values{
|
||||||
"response_type": {"code"},
|
"response_type": {"code"},
|
||||||
"client_id": {clientID},
|
"client_id": {clientID},
|
||||||
@ -180,7 +180,7 @@ func (h *ProxyHandler) OAuthCallbackHandler(w http.ResponseWriter, r *http.Reque
|
|||||||
|
|
||||||
// 获取访问令牌
|
// 获取访问令牌
|
||||||
redirectURI := getCallbackURL(r)
|
redirectURI := getCallbackURL(r)
|
||||||
resp, err := http.PostForm("https://connect.q58.club/api/oauth/access_token",
|
resp, err := http.PostForm("https://connect.czl.net/api/oauth2/token",
|
||||||
url.Values{
|
url.Values{
|
||||||
"code": {code},
|
"code": {code},
|
||||||
"redirect_uri": {redirectURI},
|
"redirect_uri": {redirectURI},
|
||||||
@ -198,7 +198,7 @@ func (h *ProxyHandler) OAuthCallbackHandler(w http.ResponseWriter, r *http.Reque
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
req, _ := http.NewRequest("GET", "https://connect.q58.club/api/oauth/user", nil)
|
req, _ := http.NewRequest("GET", "https://connect.czl.net/api/oauth2/userinfo", nil)
|
||||||
req.Header.Set("Authorization", "Bearer "+token.AccessToken)
|
req.Header.Set("Authorization", "Bearer "+token.AccessToken)
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
userResp, err := client.Do(req)
|
userResp, err := client.Do(req)
|
||||||
|
@ -17,7 +17,7 @@ export default function LoginPage() {
|
|||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<Button onClick={handleLogin} className="w-full">
|
<Button onClick={handleLogin} className="w-full">
|
||||||
使用 Q58 账号登录
|
使用 CZL Connect 登录
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user