Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Open
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
2 changes: 2 additions & 0 deletions config/domains/default.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ module.exports = {
// Simple password login, make sure you choose a very secure password.
// password: {
// token: "YOUR-PASSWORD" // any user that knows this can log in
// -- or --
// tokens: ["ONE-PASSWORD", "ANOTHER-PASSWORD"] // either of these can be used
// },

// Register a new oauth app on Google Apps at
Expand Down
8 changes: 3 additions & 5 deletions lib/proxy_domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ class ProxyDomain {
passport.use(
`${this.options.domain}-local`,
new LocalStrategy({ tokenField: "password" }, function(token, cb) {
if (
config.token &&
config.token.length === token.length &&
safeCompare(config.token, token)
) {
const tokens = config.token ? [config.token] : config.tokens || [];

if (tokens.find(t => t.length && t.length == token.length && safeCompare(t, token))) {
log.info("Authenticated with password login");
return cb(null, { password: { authenticated: true } });
} else {
Expand Down