mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-14 13:47:16 +02:00
hide sso button, if sso is not available
This commit is contained in:
parent
b98a3b422c
commit
5060e0b728
@ -15,7 +15,7 @@
|
|||||||
<button type="submit" :disabled="processing" class="bg-blue-600 hover:bg-blue-800 px-8 py-1 mt-3 rounded-md text-white text-center transition duration-300 ease-in-out focus:outline-none">{{ processing ? 'Checking...' : 'Submit' }}</button>
|
<button type="submit" :disabled="processing" class="bg-blue-600 hover:bg-blue-800 px-8 py-1 mt-3 rounded-md text-white text-center transition duration-300 ease-in-out focus:outline-none">{{ processing ? 'Checking...' : 'Submit' }}</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="w-full flex justify-end">
|
<div v-if="ssoAvailable" class="w-full flex justify-end">
|
||||||
<a href="/oidc/login"><ui-btn :disabled="processing" class="bg-blue-600 hover:bg-blue-800 px-8 py-1 mt-3 rounded-md text-white text-center transition duration-300 ease-in-out focus:outline-none">SSO</ui-btn></a>
|
<a href="/oidc/login"><ui-btn :disabled="processing" class="bg-blue-600 hover:bg-blue-800 px-8 py-1 mt-3 rounded-md text-white text-center transition duration-300 ease-in-out focus:outline-none">SSO</ui-btn></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -31,7 +31,8 @@ export default {
|
|||||||
error: null,
|
error: null,
|
||||||
processing: false,
|
processing: false,
|
||||||
username: '',
|
username: '',
|
||||||
password: null
|
password: null,
|
||||||
|
ssoAvailable: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -143,10 +144,19 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async checkSSO() {
|
||||||
|
const res = await fetch("/oidc/login", {mode: "no-cors"})
|
||||||
|
if (res.status >= 400 && res.status < 600) {
|
||||||
|
this.ssoAvailable = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.ssoAvailable = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.checkAuth()
|
this.checkAuth()
|
||||||
|
this.checkSSO()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue
Block a user