* Reverted shutdown mechanism
* Socket authentication fix for Cloudflare users
- Cloudflare formats headers
* Steam auth verbose
* Upload artifacts to CDN and send Discord webhook link in #dev
This commit is contained in:
@@ -49,18 +49,29 @@ export async function AuthenticateUserTicket(ticket: string, userid: string) {
|
||||
params.append('appid', "471710");
|
||||
params.append('ticket', ticket);
|
||||
|
||||
const res = await fetch(`https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1?${params}`);
|
||||
const resjson = (await res.json()) as SteamRes;
|
||||
|
||||
if (resjson.response.error) {
|
||||
log.w(`Steam Authentication failed: (${resjson.response.error.errorcode}) ${resjson.response.error.errordesc}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
log.d(JSON.stringify(resjson.response));
|
||||
if (resjson.response.params) return resjson.response.params.steamid === userid && resjson.response.params.ownersteamid === userid;
|
||||
else {
|
||||
log.w("Steam Authentication failed: Steam response did not contain params or error! This should never be logged!");
|
||||
try {
|
||||
const res = await fetch(`https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1?${params}`);
|
||||
const resjson = (await res.json()) as SteamRes;
|
||||
|
||||
if (resjson.response.error) {
|
||||
log.w(`Steam Authentication failed: (${resjson.response.error.errorcode}) ${resjson.response.error.errordesc}`);
|
||||
|
||||
// add more error codes later if needed
|
||||
const conditions = [
|
||||
resjson.response.error.errorcode == 100
|
||||
].includes(true);
|
||||
if (conditions) log.w('This error indicates a client problem.');
|
||||
return false;
|
||||
}
|
||||
|
||||
log.d(JSON.stringify(resjson.response));
|
||||
if (resjson.response.params) return resjson.response.params.steamid === userid && resjson.response.params.ownersteamid === userid;
|
||||
else {
|
||||
log.w("Steam Authentication failed: Steam response did not contain params or error! This should never be logged!");
|
||||
return false;
|
||||
}
|
||||
} catch (err) {
|
||||
log.w(`Steam Authentication failed: ${(err as Error).message}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user