8000 Merge branch 'step-3-dev' into step-4-dev · sparkyfen/sdk-node-tutorial@7e6c10f · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 7e6c10f

Browse files
committed
Merge branch 'step-3-dev' into step-4-dev
2 parents 6fa450a + 2ff81f4 commit 7e6c10f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ oauth.initialize(config.key, config.secret);
3030
/* Endpoints */
3131

3232
app.get('/oauth/token', function (req, res) {
33-
var token = oauth.generateStateToken(req);
33+
var token = oauth.generateStateToken(req.session);
3434

3535
res.json({
3636
token: token
@@ -40,8 +40,10 @@ app.get('/oauth/token', function (req, res) {
4040

4141
app.post('/oauth/signin', function (req, res) {
4242
var code = req.body.code;
43-
oauth.auth(code, req)
44-
.then(function (r) {
43+
oauth.auth('google', req.session, {
44+
code: code
45+
})
46+
.then(function (request_object) {
4547
// Here the user is authenticated, and the access token
4648
// for the requested provider is stored in the session.
4749
// Continue the tutorial or checkout the step-4 to get

0 commit comments

Comments
 (0)
0