Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#8031 from vangorra/oauth2-server
Browse files Browse the repository at this point in the history
Adding support for node-oauth2-server.
  • Loading branch information
horiuchi committed Feb 10, 2016
2 parents f808107 + 44e58e0 commit d8b1685
Show file tree
Hide file tree
Showing 2 changed files with 443 additions and 0 deletions.
19 changes: 19 additions & 0 deletions oauth2-server/oauth2-server-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// <reference path="../express/express.d.ts" />
/// <reference path="oauth2-server.d.ts" />

import * as express from "express";
import * as oauthserver from "oauth2-server";

var oauth = oauthserver({
model: {},
grants: ['password'],
debug: true
});

var app = express();

app.all('/oauth/token', oauth.grant());
app.get('/', oauth.authorise(), function (req, res) {
res.send('Secret area');
});
app.use(oauth.errorHandler());
Loading

0 comments on commit d8b1685

Please sign in to comment.