File tree Expand file tree Collapse file tree
core/src/components/login Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747
4848<script type="ts">
4949import { browserSupportsWebAuthn } from ' @simplewebauthn/browser'
50+ import { getBaseUrl } from ' @nextcloud/router'
5051import { defineComponent } from ' vue'
5152import {
5253 NoValidCredentials ,
@@ -136,9 +137,15 @@ export default defineComponent({
136137
137138 return finishAuthentication (challenge)
138139 .then (({ defaultRedirectUrl }) => {
139- console .debug (' Logged in redirecting' )
140- // Redirect url might be false so || should be used instead of ??.
141- window .location .href = redirectUrl || defaultRedirectUrl
140+ logger .debug (' Logged in redirecting' )
141+ if (redirectUrl) {
142+ if (redirectUrl .charAt (0 ) !== " /" ) {
143+ redirectUrl = " /" + redirectUrl;
144+ }
145+ window .location .href = getBaseUrl () + redirectUrl
146+ } else {
147+ window .location .href = defaultRedirectUrl
148+ }
142149 })
143150 .catch (error => {
144151 console .debug (' GOT AN ERROR WHILE SUBMITTING CHALLENGE!' )
You can’t perform that action at this time.
0 commit comments