Skip to content

Commit

Permalink
refactor: make allyManager.config property public
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 23, 2024
1 parent 825e402 commit 5336914
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/ally_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ import type { AllyDriverContract, AllyManagerDriverFactory } from './types.js'
* HTTP request. The drivers are cached during the lifecycle of a request.
*/
export class AllyManager<KnownSocialProviders extends Record<string, AllyManagerDriverFactory>> {
/**
* Config with the list of social providers
*/
#config: KnownSocialProviders
#ctx: HttpContext
#driversCache: Map<keyof KnownSocialProviders, AllyDriverContract<any, any>> = new Map()

constructor(config: KnownSocialProviders, ctx: HttpContext) {
constructor(
public config: KnownSocialProviders,
ctx: HttpContext
) {
this.#ctx = ctx
this.#config = config
}

/**
Expand All @@ -38,7 +36,7 @@ export class AllyManager<KnownSocialProviders extends Record<string, AllyManager
return this.#driversCache.get(provider) as ReturnType<KnownSocialProviders[SocialProvider]>
}

const driver = this.#config[provider]
const driver = this.config[provider]
if (!driver) {
throw new RuntimeException(
`Unknown ally provider "${String(
Expand Down

0 comments on commit 5336914

Please sign in to comment.