refactor(auth): Update OAuth URLs and button text for CZL Connect integration

This commit is contained in:
wood chen 2025-03-03 23:08:27 +08:00
parent 4af1592021
commit 3810153f8e
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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>