Skip to content

Commit 9abf314

Browse files
KidkArolisdaffl
authored andcommitted
fix: Correctly read the oauth strategy config (#1349)
1 parent dd519f6 commit 9abf314

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/authentication-oauth/src/strategy.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ export interface OAuthProfile {
1616

1717
export class OAuthStrategy extends AuthenticationBaseStrategy {
1818
get configuration () {
19-
const { entity, service, entityId } = this.authentication.configuration;
19+
const { entity, service, entityId, oauth } = this.authentication.configuration;
20+
const config = oauth[this.name];
2021

2122
return {
2223
entity,
2324
service,
2425
entityId,
25-
...super.configuration
26+
...config
2627
};
2728
}
2829

packages/authentication-oauth/test/strategy.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ describe('@feathersjs/authentication-oauth/strategy', () => {
1212
assert.ok(strategy.configuration.entity);
1313
});
1414

15+
it('reads configuration from the oauth key', () => {
16+
const testConfigValue = Math.random()
17+
app.get('authentication').oauth.test.hello = testConfigValue
18+
assert.strictEqual(strategy.configuration.hello, testConfigValue)
19+
});
20+
1521
it('getRedirect', async () => {
1622
app.get('authentication').oauth.redirect = '/home';
1723

0 commit comments

Comments
 (0)