From 27ea1c1e1b7db29e8c2c17847c2429d18eb28b32 Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Wed, 15 May 2019 14:07:09 +0200 Subject: [PATCH] Adds a temporary route for checking Personal Access Tokens work --- server/server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/server.js b/server/server.js index 2ec69ba3..eadfcb06 100644 --- a/server/server.js +++ b/server/server.js @@ -100,6 +100,12 @@ app.use('/api', requestsOfTypeJSON(), sessions); app.use('/api', requestsOfTypeJSON(), files); app.use('/api', requestsOfTypeJSON(), projects); app.use('/api', requestsOfTypeJSON(), aws); + +// This is a temporary way to test access via Personal Access Tokens +// Sending a valid username: combination will +// return the user's information. +app.get('/api/auth/access-check', passport.authenticate('basic', { session: false }), (req, res) => res.json(req.user)); + app.use(assetRoutes); // this is supposed to be TEMPORARY -- until i figure out // isomorphic rendering