Skip to content

Commit

Permalink
Fixed CSRF issue
Browse files Browse the repository at this point in the history
state object was saved in encoded form and was retrieved in decoded one
  • Loading branch information
mystery-man committed Apr 4, 2016
1 parent d2f91c9 commit e2d5683
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/auth.js
Expand Up @@ -36,11 +36,12 @@
res = null;
}

state = encodeURIComponent(state || newState());
state = state || newState();
redirectURI = redirectURI || args.callback;
states[state] = {
redirectURI: redirectURI,
};
state = encodeURIComponent(state);

var url = util.format("https://www.linkedin.com/uas/oauth2/authorization?response_type=code" +
"&client_id=%s" +
Expand Down

0 comments on commit e2d5683

Please sign in to comment.