MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / authInfoHandler

Function authInfoHandler

appengine/endpoints/app.js:28–35  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

26});
27
28const authInfoHandler = (req, res) => {
29 let authUser = {id: 'anonymous'};
30 const encodedInfo = req.get('X-Endpoint-API-UserInfo');
31 if (encodedInfo) {
32 authUser = JSON.parse(Buffer.from(encodedInfo, 'base64'));
33 }
34 res.status(200).json(authUser);
35};
36
37app.get('/auth/info/googlejwt', authInfoHandler);
38app.get('/auth/info/googleidtoken', authInfoHandler);

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected