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