Updates
This commit is contained in:
+15
-17
@@ -141,9 +141,9 @@ async function githubAuth({
|
||||
* @description Look for local db settings in `.env` file and by pass the http request if available
|
||||
*/
|
||||
const {
|
||||
DSQL_HOST,
|
||||
DSQL_USER,
|
||||
DSQL_PASS,
|
||||
DSQL_DB_HOST,
|
||||
DSQL_DB_USERNAME,
|
||||
DSQL_DB_PASSWORD,
|
||||
DSQL_DB_NAME,
|
||||
DSQL_KEY,
|
||||
DSQL_REF_DB_NAME,
|
||||
@@ -151,9 +151,9 @@ async function githubAuth({
|
||||
} = process.env;
|
||||
|
||||
if (
|
||||
DSQL_HOST?.match(/./) &&
|
||||
DSQL_USER?.match(/./) &&
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_HOST?.match(/./) &&
|
||||
DSQL_DB_USERNAME?.match(/./) &&
|
||||
DSQL_DB_PASSWORD?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {import("../../package-shared/types").DSQL_DatabaseSchemaType | undefined | undefined} */
|
||||
@@ -167,17 +167,15 @@ async function githubAuth({
|
||||
dbSchema = JSON.parse(fs.readFileSync(localDbSchemaPath, "utf8"));
|
||||
} catch (error) {}
|
||||
|
||||
if (dbSchema) {
|
||||
httpResponse = await apiGithubLogin({
|
||||
code,
|
||||
email: email || undefined,
|
||||
clientId,
|
||||
clientSecret,
|
||||
additionalFields,
|
||||
res: response,
|
||||
database: DSQL_DB_NAME,
|
||||
});
|
||||
}
|
||||
httpResponse = await apiGithubLogin({
|
||||
code,
|
||||
email: email || undefined,
|
||||
clientId,
|
||||
clientSecret,
|
||||
additionalFields,
|
||||
res: response,
|
||||
database: DSQL_DB_NAME,
|
||||
});
|
||||
} else {
|
||||
/**
|
||||
* Make https request
|
||||
|
||||
@@ -124,12 +124,13 @@ async function googleAuth({
|
||||
*
|
||||
* @description Look for local db settings in `.env` file and by pass the http request if available
|
||||
*/
|
||||
const { DSQL_HOST, DSQL_USER, DSQL_PASS, DSQL_DB_NAME } = process.env;
|
||||
const { DSQL_DB_HOST, DSQL_DB_USERNAME, DSQL_DB_PASSWORD, DSQL_DB_NAME } =
|
||||
process.env;
|
||||
|
||||
if (
|
||||
DSQL_HOST?.match(/./) &&
|
||||
DSQL_USER?.match(/./) &&
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_HOST?.match(/./) &&
|
||||
DSQL_DB_USERNAME?.match(/./) &&
|
||||
DSQL_DB_PASSWORD?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./) &&
|
||||
useLocal
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user