LDAP first login BUG fixed
This commit is contained in:
parent
3e374db722
commit
6beac55826
2 changed files with 6 additions and 2 deletions
|
@ -195,7 +195,7 @@ if (LdapStrategy) {
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof interoperableErrors.NotFoundError) {
|
if (err instanceof interoperableErrors.NotFoundError) {
|
||||||
const userId = await users.create(null, {
|
const userId = await users.create(contextHelpers.getAdminContext(), {
|
||||||
username: profile[config.ldap.uidTag],
|
username: profile[config.ldap.uidTag],
|
||||||
role: config.ldap.newUserRole,
|
role: config.ldap.newUserRole,
|
||||||
namespace: config.ldap.newUserNamespaceId
|
namespace: config.ldap.newUserNamespaceId
|
||||||
|
|
|
@ -258,7 +258,11 @@ async function getByAccessToken(accessToken) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getByUsername(username) {
|
async function getByUsername(username) {
|
||||||
return await _getBy(contextHelpers.getAdminContext(), 'username', username);
|
try{
|
||||||
|
return await _getBy(contextHelpers.getAdminContext(), 'username', username);
|
||||||
|
}catch(err){
|
||||||
|
throw new interoperableErrors.NotFoundError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getByUsernameIfPasswordMatch(context, username, password) {
|
async function getByUsernameIfPasswordMatch(context, username, password) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue