Skip to content

Commit

Permalink
fix auth providers
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Nov 24, 2024
1 parent f36b518 commit 928f830
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
14 changes: 9 additions & 5 deletions lib/initProstgles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as pgPromise from "pg-promise";
import pg from "pg-promise/typescript/pg-subset";
import { isEmpty } from "prostgles-types";
import { getKeys, isEmpty } from "prostgles-types";
import { AuthHandler } from "./Auth/AuthHandler";
import { DBEventsManager } from "./DBEventsManager";
import { DBOFullyTyped } from "./DBSchemaBuilder";
Expand Down Expand Up @@ -58,6 +58,7 @@ export type InitResult = {
getTSSchema: () => string;
update: (newOpts: UpdateableOptions) => Promise<void>;
restart: () => Promise<InitResult>;
options: ProstglesInitOptions;
}

export const initProstgles = async function(this: Prostgles, onReady: OnReadyCallbackBasic, reason: OnInitReason): Promise<InitResult> {
Expand Down Expand Up @@ -165,22 +166,25 @@ export const initProstgles = async function(this: Prostgles, onReady: OnReadyCal
pgp,
io: this.opts.io,
getTSSchema: this.getTSFileContent,
options: this.opts,
update: async (newOpts) => {

getKeys(newOpts).forEach(k => {
//@ts-ignore
this.opts[k] = newOpts[k];
});

if("fileTable" in newOpts){
this.opts.fileTable = newOpts.fileTable;
await this.initFileTable();
}
if("restApi" in newOpts){
this.opts.restApi = newOpts.restApi;
await this.initRestApi();
}
if("tableConfig" in newOpts){
this.opts.tableConfig = newOpts.tableConfig;
await this.initTableConfig({ type: "prgl.update", newOpts });
await this.refreshDBO();
}
if("schema" in newOpts){
this.opts.schema = newOpts.schema;
await this.initTableConfig({ type: "prgl.update", newOpts });
await this.refreshDBO();
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.2.138",
"version": "4.2.139",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 928f830

Please sign in to comment.