@lighthouseapps/oauth2-server
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,2 +7,5 @@ 'use strict'; | ||
const Password = require('./lib/Password'); | ||
const { | ||
replaceResponse | ||
} = require('./lib/util'); | ||
@@ -40,3 +43,3 @@ class EggOAuth2 { | ||
const response = new Response(ctx.response); | ||
const response = new Response(replaceResponse(ctx.response)); | ||
@@ -43,0 +46,0 @@ try { |
@@ -7,2 +7,5 @@ 'use strict'; | ||
const Password = require('./lib/Password'); | ||
const { | ||
replaceResponse | ||
} = require('./lib/util'); | ||
@@ -43,3 +46,3 @@ class ExpressOAuth2 { | ||
const response = new Response(req); | ||
const response = new Response(replaceResponse(req)); | ||
@@ -46,0 +49,0 @@ try { |
@@ -23,1 +23,20 @@ 'use strict'; | ||
}; | ||
exports.replaceResponse = res => { | ||
const response = { | ||
headers: {} | ||
}; | ||
Object.keys(res).forEach(key => { | ||
if(key !== 'headers') | ||
response[key] = res[key]; | ||
}); | ||
Object.keys(res.headers).forEach(key => { | ||
response.headers[key] = res.headers[key]; | ||
}); | ||
response.header = response.headers; | ||
return response; | ||
}; |
{ | ||
"name": "@lighthouseapps/oauth2-server", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59521
1641