Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MONGODB_URI=mongodb://mongodb:27017/dpdmongo?authSource=admin
SESSION_SECRET=foooo
SMTP_HOST=your.smtpserver.com
SMTP_PORT=587
SMTP_HOST=mailcatcher
SMTP_PORT=1025
SMTP_USER=yoursmtpuser
SMTP_PASS=yoursmtppassword
ADMIN_EMAIL=adminaccountemail@example.com
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ app_build
# CDK asset staging directory
.cdk.staging
cdk.out

# local SSL
certs
Empty file modified make-cert.sh
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions server/controllers/authController/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const AuthController = {
mail,
account_expires,
preferences: { config: configuration._id.toString() },
access: ["MA"],
}
const newUser = await UserModel.create(appDb, newUserAttributes)
const registrationMailer = new RegistrationMailer(newUser)
Expand Down
3 changes: 3 additions & 0 deletions server/utils/passport/ensure-authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export default async function ensureAuthenticated(req, res, next) {
return res
.status(403)
.json({ error: 'Account is blocked, please contact your admin' })
// this next one is the problem line--- by default the user has no access,
// but that cuts them off from the entire API, including for things
// on their dashboard
case access.length === 0:
return res.status(403).json({ error: 'Forbidden.' })
default:
Expand Down