Skip to content

Which user info is safe to expose on the client side? #18

Discussion options

You must be logged in to vote

Can you tell me where that screenshot is from, and how the data is stored in Mongoose? Adapters only return what's stored in the database and lucia-sveltekit picks what's needed from it. hashed_password should be returned from adapters but should not be passed onto the client.

The object returned from get functions should be :

type DatabaseUser<UserData extends {}> = {
    id: string;
    hashed_password: string;
    identifier_token: string;
} & UserData;

So for example:

{
   id: "abcdefg",
   hashed_password: "hashed_123456789",
   identifier_token: "email:[email protected]",
   email: "[email protected]",
   username: "user"
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@SkepticMystic
Comment options

@pilcrowonpaper
Comment options

@pilcrowonpaper
Comment options

@SkepticMystic
Comment options

@SkepticMystic
Comment options

Answer selected by pilcrowonpaper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants