Skip to content

Commit

Permalink
fix: edit user returns correct URL
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritanand committed Nov 23, 2023
1 parent 5d67f9f commit 9ea98a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 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.33",
"version": "1.0.34",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
17 changes: 2 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,15 @@ export class AuthLiteClient {
else throw new Error("Must provide org_id");
}

async generateEditUserUrl(accessToken: string, url: string): Promise<string> {
const headers = { accept: "application/json" };
generateEditUserUrl(accessToken: string, url: string): string {
const params = new URLSearchParams({
AccessToken: accessToken,
api_key: this.apiKey,
signed_key: this.signedKey,
url: url,
});

const apiResult = await makeRequest(
"https://api.trustauthx.com/api/user/me/settings/?" + params.toString(),
{ headers }
);
// return fetch('https://api.trustauthx.com/api/user/me/settings/?' + params.toString(), {
// method: 'GET',
// headers: headers,
// }).then((response) => {
// return response.url;
// });
return apiResult.url!;
// DONE need to retun the url got from apiResult and also need to give the generics to the makeRequest function
// DONE fix the return type as well
return `https://api.trustauthx.com/api/user/me/settings/?${params.toString()}`;
}

async reAuth(code: string): Promise<{ email: string; uid: string }> {
Expand Down

0 comments on commit 9ea98a6

Please sign in to comment.