Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions core/src/components/login/PasswordLessLoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</template>

<script type="ts">
import { getBaseUrl } from '@nextcloud/router'
import { browserSupportsWebAuthn } from '@simplewebauthn/browser'
import { defineComponent } from 'vue'
import {
Expand Down Expand Up @@ -132,13 +133,19 @@ export default defineComponent({
this.$emit('update:username', this.user)
},
completeAuthentication(challenge) {
const redirectUrl = this.redirectUrl
let redirectUrl = this.redirectUrl

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!')
Expand Down
4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

Loading