fix: 🐛 change password route should not error (#1228)
This commit is contained in:
1 parent
b722fa361b
commit
c675f790ef
2 files changed
+13
-3
No files matched your search
@@ -43,7 +43,7 @@ const commandHandlers = {
|
||||
scope: scopeAttrs,
|
||||
id: 'token123',
|
||||
token: 'thetokenstring',
|
||||
account_id: '1',
|
||||
account_id: 'authenticatedaccount',
|
||||
user_id: 'authenticateduser',
|
||||
auth_method_id: 'authmethod123',
|
||||
created_time: '',
|
||||
|
||||
@@ -17,8 +17,6 @@ export default function (server) {
|
||||
'withChildren'
|
||||
)[0];
|
||||
|
||||
server.create('user', { id: 'authenticateduser', scope: globalScope });
|
||||
|
||||
// Auth
|
||||
const globalAuthMethods = server.createList(
|
||||
'auth-method',
|
||||
@@ -32,6 +30,18 @@ export default function (server) {
|
||||
{ scope: orgScope },
|
||||
'withAccountsAndUsersAndManagedGroups'
|
||||
);
|
||||
// Authenticated user/account
|
||||
const user = server.create('user', {
|
||||
id: 'authenticateduser',
|
||||
scope: globalScope,
|
||||
});
|
||||
const { id: accountID } = server.create('account', {
|
||||
id: 'authenticatedaccount',
|
||||
scope: globalScope,
|
||||
authMethod: globalAuthMethods[0],
|
||||
type: 'password',
|
||||
});
|
||||
user.update({ accountIds: [accountID] });
|
||||
// Assign primary auth methods per scope
|
||||
// TODO make this generic
|
||||
globalScope.update({ primaryAuthMethodId: globalAuthMethods[0].id });
|
||||
|
||||
Reference in new issue
Block a user