mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: Always redirect to an absolute URL
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
911c79f076
commit
3608fca48c
1 changed files with 10 additions and 3 deletions
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
<script type="ts">
|
||||
import { browserSupportsWebAuthn } from '@simplewebauthn/browser'
|
||||
import { getBaseUrl } from '@nextcloud/router'
|
||||
import { defineComponent } from 'vue'
|
||||
import {
|
||||
NoValidCredentials,
|
||||
|
|
@ -130,9 +131,15 @@ export default defineComponent({
|
|||
|
||||
return finishAuthentication(challenge)
|
||||
.then(({ defaultRedirectUrl }) => {
|
||||
console.debug('Logged in redirecting')
|
||||
// Redirect url might be false so || should be used instead of ??.
|
||||
window.location.href = redirectUrl || defaultRedirectUrl
|
||||
logger.debug('Logged in redirecting')
|
||||
if (redirectUrl) {
|
||||
if (redirectUrl.charAt(0) !== "/") {
|
||||
redirectUrl = "/" + redirectUrl;
|
||||
}
|
||||
window.location.href = getBaseUrl() + redirectUrl
|
||||
} else {
|
||||
window.location.href = defaultRedirectUrl
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.debug('GOT AN ERROR WHILE SUBMITTING CHALLENGE!')
|
||||
|
|
|
|||
Loading…
Reference in a new issue