diff --git a/api/index.ts b/api/index.ts index 25efe59a4..9fb845152 100644 --- a/api/index.ts +++ b/api/index.ts @@ -25,8 +25,6 @@ const args = minimist(process.argv, { 'noevents', // Disable Initialization of Second Level Events 'nometrics', // Disable Sending AWS CloudWatch Metrics about each conn 'nosinks', // Disable Push to Sinks - 'local' // (experimental) Disable external calls on startup (for developing in low connectivity) - // Note this is the min for serving requests - it doesn't make it particularly functional ], string: [ 'postgres', // Postgres Connection String @@ -55,7 +53,6 @@ if (import.meta.url === `file://${process.argv[1]}`) { nometrics: args.nometrics || false, nosinks: args.nosinks || false, nocache: args.nocache || false, - local: args.local || false, }); await server(config); } diff --git a/api/lib/provider.ts b/api/lib/provider.ts index 6d446b9c1..23c87da99 100644 --- a/api/lib/provider.ts +++ b/api/lib/provider.ts @@ -23,7 +23,10 @@ export default class AuthProvider { } async login(username: string, password: string): Promise { - const api = await TAKAPI.init(new URL(this.config.server.api), new APIAuthPassword(username, password)); + const api = await TAKAPI.init( + new URL(this.config.server.api), + new APIAuthPassword(username, password) + ); const contents = await api.OAuth.login({ username, password }); @@ -32,8 +35,6 @@ export default class AuthProvider { profile = await this.config.models.Profile.from(username); } catch (err) { if (err instanceof Err && err.name === 'PublicError' && err.status === 404) { - const api = await TAKAPI.init(new URL(this.config.server.api), new APIAuthPassword(username, password)); - profile = await this.config.models.Profile.generate({ username: username, auth: await api.Credentials.generate() diff --git a/api/lib/tak-api.ts b/api/lib/tak-api.ts index bc2961327..26c323c70 100644 --- a/api/lib/tak-api.ts +++ b/api/lib/tak-api.ts @@ -36,6 +36,7 @@ export default class TAKAPI { this.auth = auth; this.Package = new Package(this); + this.OAuth = new OAuth(this); this.Export = new Export(this); this.Mission = new Mission(this); this.MissionLog = new MissionLog(this); diff --git a/api/test/flight.ts b/api/test/flight.ts index 06fb8b5a1..6d9d4c1d3 100644 --- a/api/test/flight.ts +++ b/api/test/flight.ts @@ -226,7 +226,6 @@ export default class Flight { nosinks: true, nocache: true, nometrics: true, - local: true }); Object.assign(this.config, custom);