From 4a237b0703605f762fb2efe4e7d71dc6614cad8c Mon Sep 17 00:00:00 2001 From: tigerbot Date: Thu, 15 Jun 2017 12:45:19 -0600 Subject: [PATCH] fixed problem creating node storage directory --- oauth3.node.storage.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oauth3.node.storage.js b/oauth3.node.storage.js index 22ee06b..370c678 100644 --- a/oauth3.node.storage.js +++ b/oauth3.node.storage.js @@ -9,6 +9,11 @@ var sessionsdir = path.join(oauth3dir, 'sessions'); var directivesdir = path.join(oauth3dir, 'directives'); var metadir = path.join(oauth3dir, 'meta'); +// We can reasonably assume the existence of the home directory, but we can't assume +// that there will already be a `.oauth3` directory or anything inside of it. +if (!fs.existsSync(path.join(oauth3dir, '..'))) { + fs.mkdirSync(path.join(oauth3dir, '..')); +} if (!fs.existsSync(oauth3dir)) { fs.mkdirSync(oauth3dir); }