diff --git a/webpack/data/login.js b/webpack/data/login.js new file mode 100644 index 0000000..7fd98d3 --- /dev/null +++ b/webpack/data/login.js @@ -0,0 +1,3 @@ +gstore.add('popup_click', function(){ + window.pop = window.open('https://sso.univ-pau.fr/cas/login?service=http://ptut.com:8080/api/v/1.0/cas', '_blank', 'location=no,height=1024,width=1024,scrollbars=yes,status=no'); +}); diff --git a/webpack/page/login.js b/webpack/page/login.js index 0be826d..5544c00 100644 --- a/webpack/page/login.js +++ b/webpack/page/login.js @@ -8,7 +8,7 @@ import login_wrapper_vue from '../vue/login_wrapper.vue' /* (3) Data */ require('../data/common'); -require('../data/home'); +require('../data/login'); @@ -21,4 +21,23 @@ new Vue({ render: h => h(login_wrapper_vue) }); -console.log('login page'); \ No newline at end of file + + +/* (1) Initialize CAS pop-up mechanism */ +window.pop = { closed: false }; + +window.cas_callback = function(cas_login){ + + setTimeout( function(){ if( window.pop.closed ){ + + if( cas_login === null ){ + + // TODO: notify FAILURE + + }else + document.location = '/'; + + + } }, 1); + +}; diff --git a/webpack/vue/login_wrapper.vue b/webpack/vue/login_wrapper.vue index 74068e5..8649491 100644 --- a/webpack/vue/login_wrapper.vue +++ b/webpack/vue/login_wrapper.vue @@ -3,7 +3,7 @@