Skip to content

Commit

Permalink
patch authServer for mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
TuuKeZu committed Aug 16, 2024
1 parent b50bb7d commit 2cf4cde
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
5 changes: 2 additions & 3 deletions database/plan-api.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const { MongoClient } = require('mongodb');
const {} = require('./authentication');
const { user, password, host, port } = require('../secret.json');
const { user, password, host, port, authServer } = require('../secret.json');

const { config } = require('./user-schema');
const { public } = require('./public-api');

const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT`;
//const url = `mongodb://127.0.0.1:27017`;
const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT&authSource=${authServer}`;

const appendPlanned = (auth, code) => {
return new Promise((resolve, reject) => {
Expand Down
5 changes: 2 additions & 3 deletions database/public-api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { MongoClient } = require('mongodb');
const { user, password, host, port } = require('../secret.json');
const { user, password, host, port, authServer } = require('../secret.json');
const { defaultConfig, defaultTheme } = require('./default.json');
const { generate } = require('shortid');
const {} = require('./authentication');
Expand All @@ -11,8 +11,7 @@ const { generateHash } = require('./utility');
const utility = require('./utility');
const { resolve } = require('path');

const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT`;
//const url = `mongodb://127.0.0.1:27017`;
const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT&authSource=${authServer}`;

const wilmaAPI = 'https://wilma.otawilma.fi/api/';
//const wilmaAPI = 'http://localhost:3001/api/';
Expand Down
4 changes: 2 additions & 2 deletions database/statistics.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { MongoClient } = require('mongodb');
const { user, password, host, port } = require('../secret.json');
const { user, password, host, port, authServer } = require('../secret.json');
const { defaultConfig, defaultThemes } = require('./default.json');
const { generate } = require('shortid');
const {} = require('./authentication');

const { config } = require('./user-schema');

const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT`;
const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT&authSource=${authServer}`;
//const url = `mongodb://127.0.0.1:27017`;

const getTotalUsers = () => {
Expand Down
4 changes: 2 additions & 2 deletions database/themes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { MongoClient } = require('mongodb');
const { user, password, host, port } = require('../secret.json');
const { user, password, host, port, authServer } = require('../secret.json');
const { defaultConfig, defaultThemes } = require('./default.json');
const { generate } = require('shortid');
const {} = require('./authentication');

const { config } = require('./user-schema');

const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT`;
const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT&authSource=${authServer}`;
//const url = `mongodb://127.0.0.1:27017`;

const createTheme = (auth, preset) => {
Expand Down
4 changes: 2 additions & 2 deletions database/user-schema.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { MongoClient } = require('mongodb');
const { user, password, host, port } = require('../secret.json');
const { user, password, host, port, authServer } = require('../secret.json');
const { defaultConfig, defaultTheme } = require('./default.json');
const { generate } = require('shortid');
const {} = require('./authentication');

const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT`;
const url = `mongodb://${user}:${password}@${host}:${port}/?authMechanism=DEFAULT&authSource=${authServer}`;
//const url = `mongodb://127.0.0.1:27017`;

const login = (auth) => {
Expand Down
1 change: 0 additions & 1 deletion secret.json

This file was deleted.

0 comments on commit 2cf4cde

Please sign in to comment.