(req, res)
| 26 | }); |
| 27 | |
| 28 | const 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 | |
| 37 | app.get('/auth/info/googlejwt', authInfoHandler); |
| 38 | app.get('/auth/info/googleidtoken', authInfoHandler); |