Sign-in
Sign in with Google or Telegram (through Magic)
POST
/auth/socialPublic: no session neededLimit: 30 / 10 min per network
The browser first logs into Magic (Google: with the ID token from Google's button; Telegram: Magic's popup), then sends a Magic DID token made with magic.user.generateIdToken({ attachment: "slay-predict-login" }).
The server checks the proof's signatures and expiry, that it hasn't been used, the Google ID token (Google only), and with Magic that the wallet is ours and was opened by the same login. The account is found by this login, then by the verified Google email, else created.
Request
curl -X POST 'https://api.slay.money/api/predict/auth/social' \
-H 'Content-Type: application/json' \
-d '{"provider":"google","didToken":"WyIweGQ3…","googleIdToken":"eyJhbGciOiJSUzI1NiIs…"}'Body
providerstringrequired One of
google, telegramdidTokenstringrequiredMagic DID token, attachment
slay-predict-login, at most 15 minutes old. googleIdTokenstringRequired for Google: the ID token from Google's button.
namestringDisplay name hint (Telegram). Never trusted.
Responses
200Signed in.
tokenstringproviderstring200 response
{
"token": "sp_Qk2…",
"provider": "google"
}400Invalid, expired, reused or mismatched proof.
400 response
{
"error": "That Google account doesn't match this wallet. Try again."
}403The account is suspended.
403 response
{
"error": "This account has been suspended for violating Slay's terms.",
"code": "ACCOUNT_BANNED"
}429Rate limit reached. Wait for the window to pass.
429 response
{
"error": "Too many sign-in attempts. Wait a few minutes and try again."
}503Sign-ups are paused (new accounts only).
503 response
{
"error": "Slay is under maintenance and temporarily unavailable while we upgrade things.",
"code": "MAINTENANCE"
}