[chore] disable download oculus version with Meta login

+ Add possibility to store token with password
This commit is contained in:
MathieuG-P
2023-12-26 22:41:05 +01:00
parent 0539b0da8d
commit fa50d90941
18 changed files with 418 additions and 122 deletions
+9 -5
View File
@@ -1,6 +1,6 @@
export function isOculusTokenValid(token: string, logger?: (...args: unknown[]) => void): boolean{
// Code taken from "https://github.com/ComputerElite/QuestAppVersionSwitcher" (TokenTools.cs)
// Part of code taken from "https://github.com/ComputerElite/QuestAppVersionSwitcher" (TokenTools.cs)
logger?.("Checking if Oculus user token is valid");
@@ -12,12 +12,16 @@ export function isOculusTokenValid(token: string, logger?: (...args: unknown[])
logger?.("Token contains %. Token most likely comes from an uri and won't work");
return false;
}
if(!token.startsWith("OC")){
logger?.("Token does not start with OC.");
if(!token.startsWith("FRL")){
logger?.("Tokens must start with 'FRL'.");
return false;
}
if(token.includes("|")){
logger?.("Token contains | which usually indicates an application token which is not valid for user tokens");
logger?.("Token contains '|' which usually indicates an application token which is not valid for user tokens");
return false;
}
if(token.includes(":")){
logger?.("Token contains ':' wich can indicate that the user have copied the 'access_token' field with the token");
return false;
}
if(token.match(/OC\d{15}/)){
@@ -25,7 +29,7 @@ export function isOculusTokenValid(token: string, logger?: (...args: unknown[])
return false;
}
logger?.("Oculus user token is valid");
logger?.("Oculus user token is valid.", `token lenght : ${token.length}`);
return true;