the_aceix
10/11/2023, 4:23 PMrp_st
10/12/2023, 5:55 AMrp_st
10/12/2023, 5:56 AMrp_st
10/12/2023, 5:56 AMthe_aceix
10/12/2023, 9:28 AMthe_aceix
10/26/2023, 11:48 AMrp_st
10/26/2023, 12:46 PMthe_aceix
11/08/2023, 9:29 AMthe_aceix
11/08/2023, 9:38 AMfunc OAuthSignIn(oauthProvider, accessToken string) (string, error) {
url := fmt.Sprintf("%s/auth/signinup", os.Getenv("BASE_URL"))
data := Data{
ThirdPartyId: oauthProvider,
ClientType: "",
OAuthTokens: OAuthTokens{
AccessToken: accessToken,
},
}
payloadBuf := new(bytes.Buffer)
json.NewEncoder(payloadBuf).Encode(data)
req, _ := http.NewRequest("POST", url, payloadBuf)
req.Header.Add("rid", "thirdpartyemailpassword")
req.Header.Add("Content-Type", "application/json; charset=utf-8")
client := &http.Client{
Timeout: time.Second * 10,
}
resp, err := client.Do(req)
if err != nil {
slog.Error("error sending request", "err", err)
return "", err
}
defer resp.Body.Close()
fmt.Print(resp.Body)
// TODO: parse response and return sToken
return "", nil
}
rp_st
11/08/2023, 9:43 AMthe_aceix
11/08/2023, 11:24 AMthe_aceix
11/08/2023, 11:25 AMrp_st
11/08/2023, 2:16 PMthe_aceix
11/08/2023, 2:56 PMrp_st
11/08/2023, 3:16 PMthe_aceix
11/08/2023, 3:58 PMrp_st
11/08/2023, 4:02 PMthe_aceix
11/08/2023, 4:02 PMthe_aceix
11/08/2023, 4:03 PMrp_st
11/08/2023, 4:04 PMrp_st
11/08/2023, 4:05 PMthe_aceix
11/08/2023, 4:09 PMthe_aceix
11/08/2023, 4:10 PMthe_aceix
11/08/2023, 4:11 PMthe_aceix
11/08/2023, 4:15 PMthe_aceix
11/08/2023, 4:15 PMcurl --location --request POST '<YOUR_API_DOMAIN>/auth/signinup' \
--header 'rid: thirdpartyemailpassword' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
"thirdPartyId": "google",
"clientType": "...",
"oAuthTokens": {
"access_token": "...",
"id_token": "..."
},
}'
rp_st
11/08/2023, 6:03 PMrp_st
11/08/2023, 6:04 PMthe_aceix
11/08/2023, 6:40 PM