mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 08:31:55 +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")
|
||||
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{
|
||||
"response_type": {"code"},
|
||||
"client_id": {clientID},
|
||||
@ -180,7 +180,7 @@ func (h *ProxyHandler) OAuthCallbackHandler(w http.ResponseWriter, r *http.Reque
|
||||
|
||||
// 获取访问令牌
|
||||
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{
|
||||
"code": {code},
|
||||
"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)
|
||||
client := &http.Client{}
|
||||
userResp, err := client.Do(req)
|
||||
|
@ -17,7 +17,7 @@ export default function LoginPage() {
|
||||
<CardContent>
|
||||
<div className="space-y-4">
|
||||
<Button onClick={handleLogin} className="w-full">
|
||||
使用 Q58 账号登录
|
||||
使用 CZL Connect 登录
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
Loading…
x
Reference in New Issue
Block a user