Skip to content

Commit

Permalink
refactor: remove repeating code and update return url string
Browse files Browse the repository at this point in the history
Co-authored-by: Vivian Plasencia <[email protected]>
  • Loading branch information
waddaboo and vplasencia authored Jun 26, 2024
1 parent e3441c1 commit 59f1137
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/api-sdk/src/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,11 @@ export function joinCredentialGroup(
providerName: string,
redirectUri?: string
): string {
let resultUrl = `${baseUrl}/credentials?group=${groupId}&member=${commitment}&provider=${providerName}`

if (redirectUri) {
return `${baseUrl}/credentials?group=${groupId}&member=${commitment}&provider=${providerName}&redirect_uri=${redirectUri}/groups?redirect=true`
resultUrl += `&redirect_uri=${redirectUri}?redirect=true`
}

return `${baseUrl}/credentials?group=${groupId}&member=${commitment}&provider=${providerName}`
return resultUrl
}

0 comments on commit 59f1137

Please sign in to comment.