1
|
/* This scripts force the redirection to the homepage (/Default.aspx)
|
2
|
* if current pathname is /Connect.aspx and the current user is
|
3
|
* already associated and currently connect
|
4
|
*/
|
5
|
|
6
|
$(function(){
|
7
|
if (window.location.href.indexOf('/Connect.aspx') != -1){
|
8
|
var force_redirect = true;
|
9
|
$('#sso-url').find('a').each(function(){
|
10
|
if(this.href.indexOf('/_mandaye/accounts/mellon/logout') == -1){
|
11
|
console.log('user not connected');
|
12
|
force_redirect = false;
|
13
|
}
|
14
|
});
|
15
|
|
16
|
$('#sso-mandaye-link').find('a').each(function(){
|
17
|
if(this.href.indexOf('/_mandaye/dissociate') == -1){
|
18
|
console.log('user not associated');
|
19
|
force_redirect = false;
|
20
|
}
|
21
|
});
|
22
|
|
23
|
if (force_redirect){
|
24
|
console.log("running sso");
|
25
|
window.location = '/_mandaye/post-login';
|
26
|
}
|
27
|
|
28
|
}
|
29
|
});
|