|
@@ -8,6 +8,7 @@ import { useWebsocketsStore } from "@/stores/websockets";
|
|
|
import { useUserAuthStore } from "@/stores/userAuth";
|
|
|
import { useModalsStore } from "@/stores/modals";
|
|
|
import _validation from "@/validation";
|
|
|
+import { useConfigStore } from "@/stores/config";
|
|
|
|
|
|
const InputHelpBox = defineAsyncComponent(
|
|
|
() => import("@/components/InputHelpBox.vue")
|
|
@@ -22,6 +23,7 @@ const QuickConfirm = defineAsyncComponent(
|
|
|
const settingsStore = useSettingsStore();
|
|
|
const userAuthStore = useUserAuthStore();
|
|
|
const route = useRoute();
|
|
|
+const configStore = useConfigStore();
|
|
|
|
|
|
const { socket } = useWebsocketsStore();
|
|
|
|
|
@@ -29,6 +31,7 @@ const saveButton = ref();
|
|
|
|
|
|
const { userId } = storeToRefs(userAuthStore);
|
|
|
const { originalUser, modifiedUser } = settingsStore;
|
|
|
+const { oidcAuthentication } = storeToRefs(configStore);
|
|
|
|
|
|
const validation = reactive({
|
|
|
username: {
|
|
@@ -121,6 +124,8 @@ const changeUsername = () => {
|
|
|
};
|
|
|
|
|
|
const saveChanges = () => {
|
|
|
+ if (oidcAuthentication.value) return;
|
|
|
+
|
|
|
const usernameChanged = modifiedUser.username !== originalUser.username;
|
|
|
const emailAddressChanged =
|
|
|
modifiedUser.email.address !== originalUser.email.address;
|
|
@@ -224,13 +229,17 @@ watch(
|
|
|
autocomplete="off"
|
|
|
@keypress="onInput('username')"
|
|
|
@paste="onInput('username')"
|
|
|
+ :disabled="oidcAuthentication"
|
|
|
/>
|
|
|
- <span v-if="modifiedUser.username" class="character-counter"
|
|
|
+ <span
|
|
|
+ v-if="modifiedUser.username && !oidcAuthentication"
|
|
|
+ class="character-counter"
|
|
|
>{{ modifiedUser.username.length }}/32</span
|
|
|
>
|
|
|
</p>
|
|
|
<transition name="fadein-helpbox">
|
|
|
<input-help-box
|
|
|
+ v-if="!oidcAuthentication"
|
|
|
:entered="validation.username.entered"
|
|
|
:valid="validation.username.valid"
|
|
|
:message="validation.username.message"
|
|
@@ -249,17 +258,23 @@ watch(
|
|
|
@keypress="onInput('email')"
|
|
|
@paste="onInput('email')"
|
|
|
autocomplete="off"
|
|
|
+ :disabled="oidcAuthentication"
|
|
|
/>
|
|
|
</p>
|
|
|
<transition name="fadein-helpbox">
|
|
|
<input-help-box
|
|
|
+ v-if="!oidcAuthentication"
|
|
|
:entered="validation.email.entered"
|
|
|
:valid="validation.email.valid"
|
|
|
:message="validation.email.message"
|
|
|
/>
|
|
|
</transition>
|
|
|
|
|
|
- <SaveButton ref="saveButton" @clicked="saveChanges()" />
|
|
|
+ <SaveButton
|
|
|
+ v-if="!oidcAuthentication"
|
|
|
+ ref="saveButton"
|
|
|
+ @clicked="saveChanges()"
|
|
|
+ />
|
|
|
|
|
|
<div class="section-margin-bottom" />
|
|
|
|