8000 `setUserSession` and `replaceUserSession` Lack Error Handling for Session Storage Failures · Issue #334 · atinux/nuxt-auth-utils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
setUserSession and replaceUserSession Lack Error Handling for Session Storage Failures #334
Open
@CorrM

Description

@CorrM

The setUserSession and replaceUserSession methods return a UserSession object that reflects the intended session data, even when the data fails to persist due to storage limits 4096-byte.
This behavior creates a false assumption that the data was saved successfully.

For example:

const newSession = { user: { id: 1 }, token: "large-token-data" };
const result = await setUserSession(event, newSession);
console.log(result); // Outputs `newSession`, even if it wasn't saved

const currentSession = await getUserSession(event);
console.log(currentSession ); // Outputs outdated data

Expected Behavior

If session persistence fails, the methods should throw an error or return a status indicating failure.
The returned UserSession object should only reflect successfully persisted data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0