From 2baed530842e7a437f8f71b9346bcac8e84773cc Mon Sep 17 00:00:00 2001 From: rizal Date: Mon, 22 May 2017 11:30:07 +0200 Subject: [PATCH] add service validate option --- .gitignore | 1 + lib/cas.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3c3629e..18eb894 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +/nbproject/ \ No newline at end of file diff --git a/lib/cas.js b/lib/cas.js index 3a49580..02fec3e 100644 --- a/lib/cas.js +++ b/lib/cas.js @@ -374,9 +374,10 @@ CAS.prototype.validate = function(ticket, callback, service, renew) pgtURL = this.pgt_url; if (ticket.indexOf('PT-') == 0) { validate_path = 'proxyValidate'; + } else if (ticket.indexOf('ST-') == 0) { + validate_path = 'serviceValidate'; } else { - //validate_path = 'serviceValidate'; - validate_path = 'proxyValidate'; + throw new Error('can not determine validate path based on ticket prefix.'); } }