Is it possible to work with more than one user logged in?
One development team working without overthrowing the other?
If you use projects, you can have multiple people working on their own branches in their own editor, but the flow editor isn't really meant for more than one user simultaneously.
Ahh I understood, I really wanted to work in flow, unfortunately it is not possible to have a team working in the same flow together
Yes. You just have to be careful. When User A deploys changes, all of the other users will be notified and asked to review and merge those changes into their workspace. It isn't the best developer experience, but it's better than the old days when User B wouldn't know User A had updated the flows and would completely overwrite them with their own.
So Nick, when a user logs in to the previous session is dropped, do you have any documentation that I can solve this problem?
I stand corrected. Just tested it out and it looks like deploying in one tab no longer murders my undeployed edits in another. Kick ass! When did you do that?
Sorry, not sure what you mean here. Can you explain a bit more what scenario you are concerned about?
I have a team with 4 people developers and whenever a user logs in the nodeRED the interface drops allowing only one user logged into the server
That doesn't sound right.... do they share the same user/password or do they each have their own?
Each one has its own user
I cannot reproduce that behaviour. I have an instance with two different users defined in adminAuth
. I have two separate browser sessions, each logged in as a different user. They can both interact with the editor and deploy changes.
How have you setup adminAuth for your instance?
I'm with these settings
const Concore = require("concore-sdk-js");
// Conecta no datacore master por padrão;
const APP_ID = process.env.APP_ID || ' ';
const APP_KEY= process.env.APP_KEY || ' ';
if (APP_ID === 'datacoreMaster') {
console.warn('Login configurado para datacoreMaster');
}
Concore.init('https://api.concore.io/api', APP_ID, APP_KEY);
module.exports = {
type: "credentials",
users: function(username) {
console.log(`Checking ${username}`);
return new Promise(function(resolve) {
// Do whatever work is needed to check username is a valid
// user.
const { Auth } = Concore.Datacore;
if (!Auth.isLogged()) {
resolve(null);
return;
}
const currentUser = Auth.getUser();
console.log(currentUser);
let valid = false;
if (currentUser && currentUser.getAtoms('username') === username) {
valid = true;
}
if (valid) {
// Resolve with the user object. It must contain
// properties 'username' and 'permissions'
var user = { username: username, permissions: "*" };
console.log(`${user.username} can ${user.permissions}`);
resolve(user);
} else {
// Resolve with null to indicate this user does not exist
console.log(`${username} does not exist`);
resolve(null);
}
});
},
authenticate: function(username,password) {
console.log(`Loggin in ${username}`);
return new Promise(function(resolve) {
const { Auth } = Concore.Datacore;
let userId;
Auth.login(username, password)
.then(res => {
console.log(`User ${res.getId()} found`);
userId = res.getId();
const { MoleculeQuery } = Concore.Datacore;
const query = new MoleculeQuery('Role');
query.equalTo('name', 'Administrators');
return query.first();
})
.then(adminGroup => {
let isAdmin = false;
const users = adminGroup.getAtoms('users');
users.forEach(u => {
if (u.id === userId) {
console.log(`User ${username} is ADMIN`);
isAdmin = true;
var user = { username: username, permissions: "*" };
resolve(user);
return;
}
});
if (!isAdmin) {
console.log(`User ${username} is NOT ADMIN`);
resolve(null);
}
})
.catch(err => {
console.error(err);
resolve(null);
});
});
},
default: function() {
return new Promise(function(resolve) {
// Resolve with the user object for the default user.
// If no default user exists, resolve with null.
// resolve({anonymous: true, permissions:"read"});
resolve(null);
});
}
}
Ah - so you are using a custom auth plugin. Have you debugged why it is logging people out?
Mr, good afternoon!
A promise simply drops the authenticated user, does this form of authentication support multiple users?
Not really sure what you mean. Yes, custom auth plugins support multiple users - they wouldn't be very useful if they didn't.
Problem solved!
My method was having problems in the validation if, I removed it because it was returning false the new user, thus knocking down the previous user!
Thank you! o/