Skip to content

Commit

Permalink
Update check for login route in middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Vassilis Barzokas authored and KamuelaFranco committed Jan 17, 2020
1 parent d39d89b commit f25a3e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const createServer = (config, db, log, Database) => {
// Authorise all requests except login
// TODO: authorise before handling CORS?
app.use(async (ctx, next) => {
if (ctx.request.path === '/login' && ctx.request.method.toLowerCase() === 'post') {
if (ctx.request.path.split('/').pop() === 'login' && ctx.request.method.toLowerCase() === 'post') {
log('bypassing validation on login request');
await next();
return;
Expand Down

0 comments on commit f25a3e7

Please sign in to comment.