Login or register via social/OAuth provider
curl --request POST \
--url https://api.sitespy.app/api/v1/auth/social-login \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"provider": "google",
"name": "John Doe"
}
'import requests
url = "https://api.sitespy.app/api/v1/auth/social-login"
payload = {
"email": "user@example.com",
"provider": "google",
"name": "John Doe"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', provider: 'google', name: 'John Doe'})
};
fetch('https://api.sitespy.app/api/v1/auth/social-login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Login successful",
"user": {
"email": "user@example.com",
"name": "John Doe",
"api_key": "abc123def456...",
"email_verified": true
}
}{
"error": "Email is required"
}Authentication
Login or register via social/OAuth provider
Authenticate a user via a social login provider (e.g., Google). If the user already exists, returns their API key. If the user doesn’t exist, auto-creates an account and returns the new API key. This endpoint is intended to be called server-side from the NextAuth callback.
POST
/
auth
/
social-login
Login or register via social/OAuth provider
curl --request POST \
--url https://api.sitespy.app/api/v1/auth/social-login \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"provider": "google",
"name": "John Doe"
}
'import requests
url = "https://api.sitespy.app/api/v1/auth/social-login"
payload = {
"email": "user@example.com",
"provider": "google",
"name": "John Doe"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com', provider: 'google', name: 'John Doe'})
};
fetch('https://api.sitespy.app/api/v1/auth/social-login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Login successful",
"user": {
"email": "user@example.com",
"name": "John Doe",
"api_key": "abc123def456...",
"email_verified": true
}
}{
"error": "Email is required"
}Body
application/json

