@txstate-mws/sveltekit-utils 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -147,6 +147,7 @@ export declare class APIBase {
147
147
  * and user. However, SubmitResponse always expects a `data` property. You can pass `user` as the dataName
148
148
  * and it will be returned as the `data` property.
149
149
  */
150
+ mutationForDialog(resp: MutationResponseFromAPI): SubmitResponse<undefined>;
150
151
  mutationForDialog(resp: MutationResponseFromAPI, { prefix }: {
151
152
  prefix?: string;
152
153
  }): SubmitResponse<undefined>;
package/dist/api.js CHANGED
@@ -302,7 +302,7 @@ export class APIBase {
302
302
  return { ...omit(m, 'arg'), path: isNull(m.arg) ? null : isNotBlank(prefix) ? m.arg.replace(RegExp('^' + prefix + '\\.'), '') : m.arg };
303
303
  });
304
304
  }
305
- mutationForDialog(resp, { prefix, dataName }) {
305
+ mutationForDialog(resp, { prefix, dataName } = {}) {
306
306
  return { success: resp.success, messages: this.messageForDialog(resp.messages, prefix), data: (dataName ? resp[dataName] : undefined) };
307
307
  }
308
308
  }
@@ -33,7 +33,7 @@ export const unifiedAuth = {
33
33
  if (isBlank(api.token))
34
34
  return;
35
35
  const authRedirect = new URL(api.authRedirect);
36
- authRedirect.pathname = '/logout';
36
+ authRedirect.pathname = [...authRedirect.pathname.split('/').slice(0, -1), 'logout'].join('/');
37
37
  authRedirect.searchParams.set('unifiedJwt', api.token);
38
38
  api.token = undefined;
39
39
  sessionStorage.removeItem('token');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@txstate-mws/sveltekit-utils",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Shared library for code that is specifically tied to sveltekit in addition to svelte.",
5
5
  "type": "module",
6
6
  "exports": {