Updates
This commit is contained in:
@@ -5,6 +5,7 @@ import encrypt from "../../../functions/dsql/encrypt";
|
||||
import grabHostNames from "../../../utils/grab-host-names";
|
||||
import apiGithubLogin from "../../../functions/api/users/social/api-github-login";
|
||||
import grabCookieExpiryDate from "../../../utils/grab-cookie-expirt-date";
|
||||
import grabDbNames from "../../../utils/grab-db-names";
|
||||
|
||||
interface FunctionReturn {
|
||||
success: boolean;
|
||||
@@ -23,7 +24,7 @@ type Param = {
|
||||
key: string;
|
||||
code: string;
|
||||
email: string | null;
|
||||
database: string;
|
||||
database?: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
response: http.ServerResponse;
|
||||
@@ -96,15 +97,8 @@ export default async function githubAuth({
|
||||
*
|
||||
* @description Look for local db settings in `.env` file and by pass the http request if available
|
||||
*/
|
||||
const {
|
||||
DSQL_DB_HOST,
|
||||
DSQL_DB_USERNAME,
|
||||
DSQL_DB_PASSWORD,
|
||||
DSQL_DB_NAME,
|
||||
DSQL_KEY,
|
||||
DSQL_REF_DB_NAME,
|
||||
DSQL_FULL_SYNC,
|
||||
} = process.env;
|
||||
const { DSQL_DB_HOST, DSQL_DB_USERNAME, DSQL_DB_PASSWORD, DSQL_DB_NAME } =
|
||||
process.env;
|
||||
|
||||
if (
|
||||
DSQL_DB_HOST?.match(/./) &&
|
||||
@@ -126,13 +120,15 @@ export default async function githubAuth({
|
||||
dbSchema = JSON.parse(fs.readFileSync(localDbSchemaPath, "utf8"));
|
||||
} catch (error) {}
|
||||
|
||||
const { dbFullName } = grabDbNames({ dbName: database });
|
||||
|
||||
httpResponse = await apiGithubLogin({
|
||||
code,
|
||||
email: email || undefined,
|
||||
clientId,
|
||||
clientSecret,
|
||||
additionalFields,
|
||||
database: DSQL_DB_NAME,
|
||||
database: dbFullName,
|
||||
additionalData,
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user