Hi,
I am freaking out… I just want to get documents from a collection server side
I have this server side: works fine
import { Meteor } from 'meteor/meteor';
import qlikauth from 'qlik-auth';
import { Apps, TemplateApps } from '/imports/api/apps.js'
import { Customers, dummyCustomers } from '../api/customers.js';
import { Streams } from '/imports/api/streams.js'
import { senseConfig, engineConfig, certs, authHeaders } from '/imports/api/config.js';
Router.route('/sso', function(request, response, next) {
console.log("Meteor's authentication module qlikAuthSSO.js received the forwarded request from Qlik Sense proxy. Meteor will now look which user is currently logged in, and request a ticket for this ID, and add his group memberships");
// console.log(request);
//first find the customers that have a logged in users (mongo returns a complete document)
var customer = Customers.findOne({ 'users.currentlyLoggedIn': true });
console.log('the simulated login received from the database: ', customer);
I have this server side (code gets called from a method) → does return undefined…
import { Meteor } from 'meteor/meteor';
import { Customers } from '/imports/api/customers';
//import config for Qlik Sense QRS
import { senseConfig, certs, authHeaders } from '/imports/api/config.js';
import lodash from 'lodash';
_ = lodash;
export function logoutUser() {
// var customer = Customers.findOne({ 'users.currentlyLoggedIn': true });
var customer = Customers.find().fetch(); //returns undefined
console.log('logout for customer ', customer);
as you can see below: the data is in mongo server side:
customer.js
export const Customers = new Mongo.Collection('customers');