diff options
| author | Pitu <[email protected]> | 2019-02-28 23:26:28 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-02-28 23:26:28 +0900 |
| commit | f37d20694386e59622fdfab586a9b580011efce6 (patch) | |
| tree | a59d69e97ccabba0d8e3ff1ba0bfc8f4341b9acd /src/api/routes/user/userGET.js | |
| parent | When a call regarding the token fails, logout (diff) | |
| download | host.fuwn.me-f37d20694386e59622fdfab586a9b580011efce6.tar.xz host.fuwn.me-f37d20694386e59622fdfab586a9b580011efce6.zip | |
Change password and api keys
Diffstat (limited to 'src/api/routes/user/userGET.js')
| -rw-r--r-- | src/api/routes/user/userGET.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/api/routes/user/userGET.js b/src/api/routes/user/userGET.js new file mode 100644 index 0000000..7929aac --- /dev/null +++ b/src/api/routes/user/userGET.js @@ -0,0 +1,21 @@ +const Route = require('../../structures/Route'); + +class usersGET extends Route { + constructor() { + super('/users/me', 'get'); + } + + run(req, res, db, user) { + return res.json({ + message: 'Successfully retrieved user', + user: { + id: user.id, + username: user.username, + isAdmin: user.isAdmin, + apiKey: user.apiKey + } + }); + } +} + +module.exports = usersGET; |