Skip to content

Commit c96cb13

Browse files
authored
dont ship blanks in clientcontext
1 parent 852fda2 commit c96cb13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/serve.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ function createHandler(dir, static) {
7777
};
7878

7979
var callback = createCallback(response);
80+
81+
// inject a client context based on auth header https://github.com/netlify/netlify-lambda/pull/57
8082
let clientContext = {}
8183
if (request.headers['authorization']) {
8284
const parts = request.headers['authorization'].split(' ')
8385
if (parts.length === 2 && parts[0] === 'Bearer') {
8486
clientContext = {
85-
identity: { url: '', token: '' },
87+
identity: { url: 'NETLIFY_LAMBDA_LOCALLY_EMULATED_IDENTITY_URL', token: 'NETLIFY_LAMBDA_LOCALLY_EMULATED_IDENTITY_TOKEN' },
8688
user: jwtDecode(parts[1])
8789
}
8890
}

0 commit comments

Comments
 (0)