fix 401 account/delete if not auth
This commit is contained in:
@ -1,9 +1,11 @@
|
|||||||
var _ = require('lodash'),
|
import _ from 'lodash';
|
||||||
async = require('async'),
|
import async from 'async';
|
||||||
moment = require('moment'),
|
import moment from 'moment';
|
||||||
debug = require('debug')('freecc:cntr:userController');
|
import debugFactory from 'debug';
|
||||||
|
|
||||||
|
import { ifNoUser401 } from '../utils/middleware';
|
||||||
|
|
||||||
|
const debug = debugFactory('freecc:boot:user');
|
||||||
const daysBetween = 1.5;
|
const daysBetween = 1.5;
|
||||||
|
|
||||||
function calcCurrentStreak(cals) {
|
function calcCurrentStreak(cals) {
|
||||||
@ -67,7 +69,11 @@ module.exports = function(app) {
|
|||||||
router.get('/email-signup', getEmailSignup);
|
router.get('/email-signup', getEmailSignup);
|
||||||
router.get('/email-signin', getEmailSignin);
|
router.get('/email-signin', getEmailSignin);
|
||||||
router.get('/account/api', getAccountAngular);
|
router.get('/account/api', getAccountAngular);
|
||||||
router.post('/account/delete', postDeleteAccount);
|
router.post(
|
||||||
|
'/account/delete',
|
||||||
|
ifNoUser401,
|
||||||
|
postDeleteAccount
|
||||||
|
);
|
||||||
router.get('/account/unlink/:provider', getOauthUnlink);
|
router.get('/account/unlink/:provider', getOauthUnlink);
|
||||||
router.get('/account', getAccount);
|
router.get('/account', getAccount);
|
||||||
// Ensure this is the last route!
|
// Ensure this is the last route!
|
||||||
|
Reference in New Issue
Block a user