From a8a81fa0de9b7879847531b7d5d9d9d154cba175 Mon Sep 17 00:00:00 2001 From: xTEddie Date: Tue, 31 Oct 2017 16:55:35 -0400 Subject: [PATCH] Prevent users to fill out confirmation form without being admitted --- app/client/src/routes.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/client/src/routes.js b/app/client/src/routes.js index b33bcf8b0..463c03714 100644 --- a/app/client/src/routes.js +++ b/app/client/src/routes.js @@ -76,6 +76,9 @@ angular.module('reg') url: "/confirmation", templateUrl: "views/confirmation/confirmation.html", controller: 'ConfirmationCtrl', + data: { + requireCompletedProfile: true + }, resolve: { currentUser: function(UserService){ return UserService.getCurrentUser(); @@ -183,6 +186,7 @@ angular.module('reg') var requireLogin = toState.data.requireLogin; var requireAdmin = toState.data.requireAdmin; var requireVerified = toState.data.requireVerified; + var requireCompletedProfile = toState.data.requireCompletedProfile; if (requireLogin && !Session.getToken()) { event.preventDefault(); @@ -199,6 +203,11 @@ angular.module('reg') $state.go('app.dashboard'); } + if (requireCompletedProfile && !Session.getUser().completedProfile) { + event.preventDefault(); + $state.go('app.dashboard'); + } + }); }]); \ No newline at end of file