fix: 🐛 change password route should not error (#1228)

This commit is contained in:
Randall Morey authored and GitHub committed 2022-07-29 15:18:57 -07:00
1 parent b722fa361b
commit c675f790ef
2 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -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: '',
+12 -2
View File
@@ -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 });