Skip to content

Commit fb3d8cc

Browse files
authored
fix(authentication-oauth): Use original headers in oauth flow (#3025)
1 parent 283dc47 commit fb3d8cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/authentication-oauth/src/service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ export class OAuthService {
9292
async authenticate(params: OAuthParams, result: GrantResponse) {
9393
const name = params.route.provider
9494
const { linkStrategy, authService } = this.settings
95-
const { accessToken, grant, query = {}, redirect } = params.session
95+
const { accessToken, grant, headers, query = {}, redirect } = params.session
9696
const strategy = this.service.getStrategy(name) as OAuthStrategy
9797
const authParams = {
9898
...params,
99+
headers,
99100
authStrategies: [name],
100101
authentication: accessToken
101102
? {
@@ -143,7 +144,7 @@ export class OAuthService {
143144
}
144145

145146
async find(params: OAuthParams) {
146-
const { session, query } = params
147+
const { session, query, headers } = params
147148
const { feathers_token, redirect, ...restQuery } = query
148149
const handlerParams = {
149150
...params,
@@ -157,6 +158,7 @@ export class OAuthService {
157158

158159
session.redirect = redirect
159160
session.query = restQuery
161+
session.headers = headers
160162

161163
return this.handler('GET', handlerParams, {})
162164
}

0 commit comments

Comments
 (0)