From 4669339a943fcbaeb0e0b0f2f37a247124d45487 Mon Sep 17 00:00:00 2001 From: Elie Rotenberg Date: Thu, 6 Jun 2024 16:37:20 +0200 Subject: [PATCH] fix: user profile extra '}', optional accessToken * Remove `}` typo in generated user profile urls * Make accessToken explicitly optional, reflecting the actual runtime behavior (typings only, no runtime changes). --- src/url.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/url.ts b/src/url.ts index a2aa459..97dc811 100644 --- a/src/url.ts +++ b/src/url.ts @@ -45,13 +45,13 @@ export class UrlSDK { return this.getSignUrl('login', redirectUri) } - public getUserProfileUrl(userName: string, accessToken: string): string { - const param = accessToken ? `?access_token=${accessToken}}` : '' + public getUserProfileUrl(userName: string, accessToken?: string): string { + const param = accessToken ? `?access_token=${accessToken}` : '' return `${this.config.endpoint}/users/${this.config.orgName}/${userName}${param}` } - public getMyProfileUrl(accessToken: string): string { - const param = accessToken ? `?access_token=${accessToken}}` : '' + public getMyProfileUrl(accessToken?: string): string { + const param = accessToken ? `?access_token=${accessToken}` : '' return `${this.config.endpoint}/account${param}` } }