Skip to content

Commit

Permalink
fix(authentication-oauth): Use original headers in oauth flow
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Jan 29, 2023
1 parent 0a1665d commit c3e9590
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/authentication-oauth/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ export class OAuthService {
async authenticate(params: OAuthParams, result: GrantResponse) {
const name = params.route.provider
const { linkStrategy, authService } = this.settings
const { accessToken, grant, query = {}, redirect } = params.session
const { accessToken, grant, headers, query = {}, redirect } = params.session
const strategy = this.service.getStrategy(name) as OAuthStrategy
const authParams = {
...params,
headers,
authStrategies: [name],
authentication: accessToken
? {
Expand Down Expand Up @@ -143,7 +144,7 @@ export class OAuthService {
}

async find(params: OAuthParams) {
const { session, query } = params
const { session, query, headers } = params
const { feathers_token, redirect, ...restQuery } = query
const handlerParams = {
...params,
Expand All @@ -157,6 +158,7 @@ export class OAuthService {

session.redirect = redirect
session.query = restQuery
session.headers = headers

return this.handler('GET', handlerParams, {})
}
Expand Down

0 comments on commit c3e9590

Please sign in to comment.