Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Option to Authenticate Users #98

Open
mrumaiz opened this issue Feb 11, 2019 · 1 comment
Open

No Option to Authenticate Users #98

mrumaiz opened this issue Feb 11, 2019 · 1 comment

Comments

@mrumaiz
Copy link

mrumaiz commented Feb 11, 2019

There is no way to authenticate users to view dashboard

@santiq
Copy link
Collaborator

santiq commented Feb 19, 2019

Hello @mrumaiz how are you?

I see your point, the documentation does not specify how, but is quite easy, you can use a package like
express-basic-auth

var express = require('express');
var app = express();
var basicAuth = require('express-basic-auth')

// ... your other express middleware like body-parser

var Agenda = require('agenda');
var Agendash = require('agendash');

var agenda = new Agenda({ db: { address: 'mongodb://127.0.0.1/agendaDb' } });
// or provide your own mongo client:
// var agenda = new Agenda({mongo: myMongoClient})

app.use('/dash', 
  basicAuth({
    users: {
      admin: "super-secure-password",
    },
    challenge: true,
  }),
  Agendash(agenda));

// ... your other routes

// ... start your server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants