mirror of
https://github.com/nextcloud/server.git
synced 2026-05-22 10:06:37 -04:00
Merge pull request #59790 from nextcloud/fix/fix-passwordless-login-redirect
fix: Harmonize login and passwordless login redirect behavior
This commit is contained in:
commit
c332ca74be
3 changed files with 13 additions and 5 deletions
|
|
@ -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
4
dist/core-login.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-login.js.map
vendored
2
dist/core-login.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue