Which user info is safe to expose on the client side? #18
-
Hey :) Thanks for this great library. I've been looking for a solution like this to SK authentication for a while now. I don't know too much about authentication, so bear with me. Is it safe to be exposing I understand that the password being hashed makes it safe, but should that info be available anyway? Is it a matter of how I wrote my adapter that this is what is returned for the user? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
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 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"
} |
Beta Was this translation helpful? Give feedback.
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 :
So for example: