Skip to content

Commit cb51252

Browse files
committed
feat(addons): Update redirect URL for user settings page
1 parent a08c403 commit cb51252

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/app/features/settings/settings-addons/components/connect-addon/connect-addon.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h2>
1111
</h2>
1212

1313
<div class="mt-4">
14-
<osf-addon-terms [addon]="addon()" />
14+
<osf-addon-terms [addon]="addon()" [redirectUrl]="redirectUrl()" />
1515
</div>
1616

1717
<div class="flex flex-column gap-2 mt-4">

src/app/features/settings/settings-addons/components/connect-addon/connect-addon.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ export class ConnectAddonComponent {
7272
updateAuthorizedAddon: UpdateAuthorizedAddon,
7373
});
7474

75+
redirectUrl = computed(() => {
76+
const addon = this.addon();
77+
if (!addon || !addon.redirectUrl) {
78+
return null;
79+
}
80+
const openURL = new URL(addon.redirectUrl);
81+
openURL.searchParams.set('userIri', this.addonsUserReference()[0]?.attributes.user_uri);
82+
return openURL.toString();
83+
});
84+
7585
constructor() {
7686
const addon = this.router.getCurrentNavigation()?.extras.state?.['addon'] as AddonModel | AuthorizedAccountModel;
7787
if (!addon) {

0 commit comments

Comments
 (0)