Skip to content

Commit 82f7a0d

Browse files
Arne HasselArne Hassel
authored andcommitted
Merge branch 'account-creation-redirect'
2 parents 79c686c + fc875c9 commit 82f7a0d

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

common/js/auth-buttons.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
// Redirect to the registration page
4444
function register () {
4545
const registration = new URL('/register', location)
46-
registration.searchParams.set('returnToUrl', location)
4746
location.href = registration
4847
}
4948
})(solid)

lib/models/user-account.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ class UserAccount {
7676
return parsed.protocol + '//' + parsed.host
7777
}
7878

79+
/**
80+
* Returns the Uri to the account's Pod
81+
*
82+
* @return {string}
83+
*/
84+
get podUri () {
85+
const webIdUrl = url.parse(this.webId)
86+
const podUrl = `${webIdUrl.protocol}//${webIdUrl.host}`
87+
return url.format(podUrl)
88+
}
89+
7990
/**
8091
* Returns the URI of the WebID Profile for this account.
8192
* Usage:

lib/requests/create-account-request.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,15 @@ class CreateOidcAccountRequest extends CreateAccountRequest {
314314
})
315315
}
316316

317+
/**
318+
* Generate the response for the account creation
319+
*
320+
* @param userAccount {UserAccount}
321+
*
322+
* @return {UserAccount}
323+
*/
317324
sendResponse (userAccount) {
318-
let redirectUrl = this.returnToUrl || this.loginUrl()
325+
let redirectUrl = this.returnToUrl || userAccount.podUri
319326
this.response.redirect(redirectUrl)
320327

321328
return userAccount

0 commit comments

Comments
 (0)