mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2024-04-21 12:32:08 +00:00
fix (admin): auth middleware
This commit is contained in:
@@ -86,14 +86,14 @@ export function getState() {
|
||||
.querySelector(`[data-bind="authentication_middleware"] [is="box-item"].active`)
|
||||
?.getAttribute("data-label");
|
||||
|
||||
const middleware = {
|
||||
identity_provider: {},
|
||||
attribute_mapping: {},
|
||||
config.middleware = {
|
||||
identity_provider: { type: null },
|
||||
attribute_mapping: null,
|
||||
};
|
||||
if (!authType) return config;
|
||||
|
||||
let formValues = [...new FormData(document.querySelector(`[data-bind="idp"]`))];
|
||||
middleware.identity_provider = {
|
||||
config.middleware.identity_provider = {
|
||||
type: authType,
|
||||
params: JSON.stringify(
|
||||
formValues
|
||||
@@ -110,7 +110,7 @@ export function getState() {
|
||||
};
|
||||
|
||||
formValues = [...new FormData(document.querySelector(`[data-bind="attribute-mapping"]`))];
|
||||
middleware.attribute_mapping = {
|
||||
config.middleware.attribute_mapping = {
|
||||
related_backend: formValues.shift()[1],
|
||||
params: JSON.stringify(formValues.reduce((acc, [key, value]) => {
|
||||
const k = key.split(".");
|
||||
@@ -121,7 +121,6 @@ export function getState() {
|
||||
}, {})),
|
||||
};
|
||||
|
||||
config.middleware = middleware;
|
||||
return config;
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -29,7 +29,7 @@ export function get() {
|
||||
export function save() {
|
||||
return rxjs.pipe(
|
||||
rxjs.tap(() => isSaving$.next(true)),
|
||||
rxjs.debounceTime(1500),
|
||||
rxjs.debounceTime(800),
|
||||
rxjs.mergeMap((formData) => ajax({
|
||||
url: "/admin/api/config",
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user