caccl-authorizer
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,3 @@ | ||
const randomstring = require('randomstring'); | ||
module.exports = (options) => { | ||
@@ -28,2 +30,3 @@ const [last, first] = options.profile.sortable_name.split(', '); | ||
body.oauth_nonce = `${randomstring.generate(48)}${new Date().getTime()}`; | ||
body.oauth_timestamp = Math.round(new Date().getTime() / 1000); | ||
@@ -30,0 +33,0 @@ body.context_id = options.course.uuid; // Double check that this is correct |
@@ -324,4 +324,9 @@ const fs = require('fs'); | ||
// Check if we encountered an internal error | ||
if (!code && (error && error === 'unsupported_response_type')) { | ||
return res.redirect(nextPath + '?success=false&reason=internal_error'); | ||
} | ||
// Check if access was denied | ||
if (!code || (error && error === 'access_denied')) { | ||
if (!code) { | ||
// Access was denied! Redirect with success=false and message | ||
@@ -328,0 +333,0 @@ return res.redirect(nextPath + '?success=false&reason=denied'); |
{ | ||
"name": "caccl-authorizer", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Acquires Canvas tokens through via OAuth, stores refresh tokens, and refreshes access tokens when they expire.", | ||
@@ -46,4 +46,5 @@ "main": "index.js", | ||
"ejs": "^2.6.1", | ||
"qs": "^6.5.2" | ||
"qs": "^6.5.2", | ||
"randomstring": "^1.1.5" | ||
} | ||
} |
36660
714
6
+ Addedrandomstring@^1.1.5
+ Addedrandombytes@2.0.3(transitive)
+ Addedrandomstring@1.3.0(transitive)