Fix commit redirect for non signed user.
Now users will be directed to sign in page and on sign in will have pledge completed
This commit is contained in:
@@ -22,11 +22,16 @@ import {
|
||||
ifNoUserRedirectTo
|
||||
} from '../utils/middleware';
|
||||
|
||||
const sendNonUserToFront = ifNoUserRedirectTo('/');
|
||||
const sendNonUserToSignIn = ifNoUserRedirectTo(
|
||||
'/login',
|
||||
'You must be signed in to commit to a non-profit'
|
||||
);
|
||||
|
||||
const sendNonUserToCommit = ifNoUserRedirectTo(
|
||||
'/commit',
|
||||
'Must be signed in to update commit'
|
||||
'You must be signed in to update commit'
|
||||
);
|
||||
|
||||
const debug = debugFactory('freecc:commit');
|
||||
|
||||
function findNonprofit(name) {
|
||||
@@ -52,7 +57,7 @@ export default function commit(app) {
|
||||
|
||||
router.get(
|
||||
'/commit/pledge',
|
||||
sendNonUserToFront,
|
||||
sendNonUserToSignIn,
|
||||
pledge
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user