agendash icon indicating copy to clipboard operation
agendash copied to clipboard

No Option to Authenticate Users

Open mrumaiz opened this issue 6 years ago • 1 comments

There is no way to authenticate users to view dashboard

mrumaiz avatar Feb 11 '19 11:02 mrumaiz

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

santiq avatar Feb 19 '19 15:02 santiq