Game sign-in kit: a remembered sign-in on this device opens on 'Continue as @name' (new POST /api/game/auth/resume turns the 29-day kit pass into a fresh hand-off token, no code; pass checked for this game, suspended accounts refused), 'Use a different account' falls back to email; Shards of Valor login ad uses the card view (frames: false)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1817,7 +1817,7 @@ const GAME_AUTH = {
|
||||
mint: (a, memberId) => swMint({ memberId: Number(memberId) || 0, email: String(a.email).toLowerCase(), username: a.username || null, wallet: a.address || null }) },
|
||||
polywarriors: { name: 'PolyWarriors', origins: () => [PW_URL()].concat(PW_ALT()), host: () => PW_URL().replace(/^https?:\/\//, ''),
|
||||
mint: (a, memberId) => pwMint({ memberId: Number(memberId) || 0, email: String(a.email).toLowerCase(), username: a.username || null, wallet: a.address || null }) },
|
||||
shardsofvalor: { name: 'Shards of Valor', origins: () => [SOV_URL()].concat(SOV_ALT()), host: () => SOV_URL().replace(/^https?:\/\//, ''),
|
||||
shardsofvalor: { name: 'Shards of Valor', frames: false, origins: () => [SOV_URL()].concat(SOV_ALT()), host: () => SOV_URL().replace(/^https?:\/\//, ''),
|
||||
mint: (a, memberId) => sovMint({ memberId: Number(memberId) || 0, email: String(a.email).toLowerCase(), username: a.username || null, wallet: a.address || null }) },
|
||||
gemkingdom: { name: 'Gem Kingdom', origins: () => [GK_URL(), 'https://gemkingdom.saasy.top'], host: () => GK_URL().replace(/^https?:\/\//, ''),
|
||||
mint: (a, memberId) => gkMint({ memberId: Number(memberId) || 0, email: String(a.email).toLowerCase(), username: a.username || null, wallet: a.address || null }) },
|
||||
@@ -2427,6 +2427,16 @@ const server = http.createServer(async (req, res) => {
|
||||
}
|
||||
return json(res, 200, await gameAnswer(g, b.game, await accounts.byEmail(pass.e)), cors);
|
||||
}
|
||||
// remembered sign-in (2026-10-19): the kit's 29-day pass for this game becomes a fresh hand-off token, no code
|
||||
if (p === '/api/game/auth/resume' && req.method === 'POST') {
|
||||
const cors = gameCors(req); const b = await readBody(req); const g = gameOf(req, b.game);
|
||||
if (!g) return json(res, 403, { error: 'This game is not connected to InstantAdPay.' }, cors);
|
||||
const pass = gamePassOpen(b.pass);
|
||||
if (!pass || (pass.g && pass.g !== b.game)) return json(res, 401, { error: 'Your sign-in expired. Start again with your email.' }, cors);
|
||||
if (fraud.isSuspended(pass.e)) return json(res, 403, { error: 'This account is suspended. Contact support at instantadpay.com/support.' }, cors);
|
||||
const acct = await accounts.byEmail(pass.e); if (!acct) return json(res, 404, { error: 'Account not found. Start again with your email.' }, cors);
|
||||
return json(res, 200, await gameAnswer(g, b.game, acct), cors);
|
||||
}
|
||||
// the game's nudges ("Add your wallet", "Level up") post the pass here in a new tab: signed in on arrival
|
||||
if (p === '/api/game/enter' && req.method === 'POST') {
|
||||
let f; try { f = new URLSearchParams((await readRaw(req, 4096)).toString('utf8')); } catch (e) { f = new URLSearchParams(); }
|
||||
|
||||
Reference in New Issue
Block a user