Merge pull request #59790 from nextcloud/fix/fix-passwordless-login-redirect

fix: Harmonize login and passwordless login redirect behavior
This commit is contained in:
Côme Chilliet 2026-04-29 23:09:29 +02:00 committed by GitHub
commit c332ca74be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 5 deletions

View file

@ -51,6 +51,7 @@
</template>
<script type="ts">
import { getBaseUrl } from '@nextcloud/router'
import { browserSupportsWebAuthn } from '@simplewebauthn/browser'
import { defineComponent } from 'vue'
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
@ -147,8 +148,15 @@ export default defineComponent({
return finishAuthentication(challenge)
.then(({ defaultRedirectUrl }) => {
logger.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) => {
logger.debug('GOT AN ERROR WHILE SUBMITTING CHALLENGE!', { error }) // Example: timeout, interaction refused...

4
dist/core-login.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long