[webpack.login] now works with CAS authentication

This commit is contained in:
xdrm-brackets 2018-03-03 16:00:43 +01:00
parent 58a527d9d1
commit 65d1e78cf2
3 changed files with 25 additions and 3 deletions

3
webpack/data/login.js Normal file
View File

@ -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');
});

View File

@ -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');
/* (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);
};

View File

@ -3,7 +3,7 @@
<div id='LOGIN_REDIRECT'>
<button class='search'>Login button</button>
<button class='valid' @click='gstore.popup_click'>Login button</button>
</div>