chore: Rebase onto feature-oidc-array-fields-crud branch

This commit is contained in:
Susmitha Girumala committed 2021-06-02 14:03:53 -04:00
1 parent 44fa206619
commit a6672ecef4
6 files changed
+69 -78

No files matched your search

+4 -28
View File
@@ -1,6 +1,6 @@
import Ember from 'ember';
import config from '../config/environment';
import { deauthHandler } from './route-handlers/auth';
import { authHandler, deauthHandler } from './route-handlers/auth';
import { pickRandomStatusString } from './factories/session';
import { Response } from 'miragejs';
import initializeMockIPC from './scenarios/ipc';
@@ -71,31 +71,6 @@ export default function () {
}
return new Response(202);
});
this.post('/auth-methods/:idMethod', function (schema, request) {
const idMethod = request.params.idMethod;
const id = idMethod.split(':')[0];
const method = idMethod.split(':')[1];
if (method === 'authenticate') {
schema.authHandler.call(this, schema, request);
return;
}
const attrs = this.normalizedRequestAttrs();
const authMethods = schema.authMethods;
const authMethod = authMethods.find(id);
let updatedAttrs = {};
if (method === 'change-state') {
updatedAttrs = {
attributes: {
state: attrs.attributes.state,
},
};
}
return authMethod.update(updatedAttrs);
});
// Auth Method Accounts
this.get(
@@ -131,8 +106,9 @@ export default function () {
}
);
// Authenticate/deauthenticate routes
// this.post('/auth-methods/:id_method', authHandler);
// Authenticate + auth methods custom routes
this.post('/auth-methods/:id_method', authHandler);
// Deauthenticate route
this.post('/scopes/:id_method', deauthHandler);
// IAM : Users