Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sveltekit session update #7722

Open
WolfVector opened this issue Jun 3, 2023 · 4 comments
Open

Sveltekit session update #7722

WolfVector opened this issue Jun 3, 2023 · 4 comments
Labels
enhancement New feature or request triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@WolfVector
Copy link

Description 📓

I'm working in a project where the user can sign in with two options: Azure and Credentials. When the user sign in using credentials, I want to give the option to change the username and update the session. Is there an implementation in sveltekit to do this?

Looking in the source code of the file /node_modules/@auth/core/src/lib/routes/session.ts, it seems like the update function could be implemented

const token = await callbacks.jwt({
        token: decodedToken,
        ...(isUpdate && { trigger: "update" }),
        session: newSession,
})

The trigger would have the "update" value and I could replace the username in the jwt callback, just like in next-auth. Also, looking at /node_modules/@auth/sveltekit/index.js seems to be the place where I could expose the update function to the client. However, I'm lost at how to do this.

Is there a way to implement it?

How to reproduce ☕️

nil

Contributing 🙌🏽

No, I am afraid I cannot help regarding this

@WolfVector WolfVector added enhancement New feature or request triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jun 3, 2023
@exipnus
Copy link

exipnus commented Oct 1, 2023

This would be nice to have

@aakash14goplani
Copy link

@WolfVector - were you able to figure out any work-around?

@WolfVector
Copy link
Author

@aakash14goplani Unfortunately no

@aakash14goplani
Copy link

Finally I was able to figure out a way to pass data between client and server: https://blog.aakashgoplani.in/how-to-exchange-data-between-client-and-server-using-sveltekitauth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

3 participants