Skip to content

Commit

Permalink
feat: getUser returns all data of user
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritanand committed Nov 22, 2023
1 parent 593194d commit c439c9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trustauthx",
"version": "1.0.31",
"version": "1.0.32",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ export class AuthLiteClient {
const data = await response.json();

const decoded = this.jwtDecode(data);
const subDecoded = JSON.parse(decoded["sub"]);
const decodedSub = JSON.parse(decoded["sub"]);
delete decoded["sub"];

return { email: subDecoded.email, uid: subDecoded.uid };
return { ...decoded, ...decodedSub };
} else {
throw new Error(
`Request failed with status code: ${
Expand Down

0 comments on commit c439c9f

Please sign in to comment.