@absolutejs/auth 0.22.6 → 0.22.7

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/index.js CHANGED
@@ -3192,19 +3192,22 @@ var signout = ({
3192
3192
  userSessionId: user_session_id.value
3193
3193
  });
3194
3194
  const signoutSession = authSessionStore ? compatibilityLayer.session : session;
3195
- try {
3196
- await onSignOut?.({
3197
- authProvider: auth_provider.value,
3198
- session: signoutSession,
3199
- userSessionId: user_session_id.value
3200
- });
3201
- } catch (err) {
3202
- console.error("[signout] Sign out operation failed:", {
3203
- authProvider: auth_provider.value,
3204
- error: err instanceof Error ? err.message : err,
3205
- stack: err instanceof Error ? err.stack : undefined
3206
- });
3207
- return status("Internal Server Error", "Sign out operation failed");
3195
+ const currentSession = signoutSession[user_session_id.value];
3196
+ if (currentSession !== undefined) {
3197
+ try {
3198
+ await onSignOut?.({
3199
+ authProvider: auth_provider.value,
3200
+ session: signoutSession,
3201
+ userSessionId: user_session_id.value
3202
+ });
3203
+ } catch (err) {
3204
+ console.error("[signout] Sign out operation failed:", {
3205
+ authProvider: auth_provider.value,
3206
+ error: err instanceof Error ? err.message : err,
3207
+ stack: err instanceof Error ? err.stack : undefined
3208
+ });
3209
+ return status("Internal Server Error", "Sign out operation failed");
3210
+ }
3208
3211
  }
3209
3212
  delete signoutSession[user_session_id.value];
3210
3213
  if (authSessionStore) {
@@ -3219,7 +3222,7 @@ var signout = ({
3219
3222
  return new Response(null, { status: 204 });
3220
3223
  }, {
3221
3224
  cookie: t8.Cookie({
3222
- auth_provider: authProviderOption,
3225
+ auth_provider: t8.Optional(authProviderOption),
3223
3226
  user_session_id: t8.Optional(t8.TemplateLiteral("${string}-${string}-${string}-${string}-${string}"))
3224
3227
  })
3225
3228
  });
@@ -13879,5 +13882,5 @@ export {
13879
13882
  AbsoluteAuthIdentityConflictError
13880
13883
  };
13881
13884
 
13882
- //# debugId=A6C23409DC7CDF3964756E2164756E21
13885
+ //# debugId=7F98E858A24BE38A64756E2164756E21
13883
13886
  //# sourceMappingURL=index.js.map