Add an optional callback to javascript cas login function
This commit is contained in:
parent
187da57be1
commit
fa6301c873
|
@ -1,4 +1,4 @@
|
||||||
function cas_login(cas_server_login, service, login_service){
|
function cas_login(cas_server_login, service, login_service, callback){
|
||||||
url = cas_server_login + '?service=' + encodeURIComponent(service);
|
url = cas_server_login + '?service=' + encodeURIComponent(service);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -17,6 +17,8 @@ function cas_login(cas_server_login, service, login_service){
|
||||||
xhrFields: {
|
xhrFields: {
|
||||||
withCredentials: true
|
withCredentials: true
|
||||||
},
|
},
|
||||||
|
success: callback,
|
||||||
|
error: function (request, textStatus, errorThrown) {},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if(data.detail == "login required"){
|
if(data.detail == "login required"){
|
||||||
|
|
Loading…
Reference in New Issue