This repository was archived by the owner on Dec 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,29 @@ async function logout() {
2323}
2424
2525const routes = [
26+ // testing route
27+ {
28+ path : "/testing" ,
29+ component : ( ) => import ( "@/views/Voting/App" ) ,
30+ children : [
31+ {
32+ path : "vote" ,
33+ name : "vote" ,
34+ component : ( ) => import ( "@/views/Voting/Ballot" )
35+ }
36+ ]
37+ } ,
2638 {
2739 // basically a dynamic home page
2840 path : "/" ,
2941 name : "redirect" ,
3042 beforeEnter ( to , from , next ) {
43+ // for testing
44+ if ( to . path === "/testing/vote" ) {
45+ console . log ( "in redirect" , to . path ) ;
46+ next ( { path : "/testing/vote" } ) ;
47+ return ;
48+ }
3149 if ( isChallengeOpen ( ) || isChallengePending ( ) ) {
3250 next ( { name : "quiz" } ) ;
3351 return ;
@@ -226,6 +244,13 @@ const router = new VueRouter({
226244} ) ;
227245
228246router . beforeEach ( async ( to , from , next ) => {
247+ // for testing
248+ if ( to . path === "/testing/vote" ) {
249+ console . log ( "bypassing beforeEach" ) ;
250+ next ( ) ;
251+ return ;
252+ }
253+
229254 const requireAuth = to . matched . some ( record => record . meta . secured ) ;
230255 const requireAnon = to . matched . some ( record => record . meta . anon ) ;
231256 const requireChallengePending = to . matched . some (
Original file line number Diff line number Diff line change @@ -213,7 +213,10 @@ export default {
213213 this .pageData .page = 1 ;
214214 await this .search ();
215215 } else {
216- this .$router .push ({ name: " redirect" });
216+ // for testing
217+ if (this .$router .history ._startLocation !== " /testing/vote" ) {
218+ this .$router .push ({ name: " redirect" });
219+ }
217220 }
218221 }
219222 this .requestCount -- ;
@@ -228,7 +231,10 @@ export default {
228231 this .pageData .page = 1 ;
229232 await this .loadPage ();
230233 } else {
231- this .$router .push ({ name: " redirect" });
234+ // for testing
235+ if (this .$router .history ._startLocation !== " /testing/vote" ) {
236+ this .$router .push ({ name: " redirect" });
237+ }
232238 }
233239 }
234240 this .requestCount -- ;
You can’t perform that action at this time.
0 commit comments