Skip to content

Commit

Permalink
* Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kcbanner committed Apr 16, 2011
1 parent 94a2c91 commit 57122ed
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Readme.md
Expand Up @@ -11,6 +11,29 @@ via npm:

## Usage

Setup:

var CAS = require('cas');
var cas = new CAS({base_url: 'https://cas.uwaterloo.ca/cas', service: 'my_service'});

Using it in a login route:

exports.cas_login = function(req, res) {
var ticket = req.param('ticket');
if (ticket) {
cas.validate(ticket, function(err, status, username) {
if (err) {
// Handle the error
res.send({error: err});
} else {
// Log the user in
res.send({status: status, username: username});
}
});
} else {
res.redirect('/');
}
};

## License

Expand Down

0 comments on commit 57122ed

Please sign in to comment.