Add a user pref to reveal dotted passwords - Closes #208

This commit is contained in:
Bubka
2023-12-05 11:40:39 +01:00
parent c75e4eb047
commit b2e733eee5
7 changed files with 35 additions and 7 deletions

View File

@ -34,7 +34,7 @@ export function useIdGenerator(fieldType, fieldName) {
}
}
export function useDisplayablePassword(pwd) {
export function useDisplayablePassword(pwd, reveal = false) {
const user = useUserStore()
if (user.preferences.formatPassword && pwd.length > 0) {
@ -48,5 +48,5 @@ export function useDisplayablePassword(pwd) {
}
}
return user.preferences.showOtpAsDot ? pwd.replace(/[0-9]/g, '●') : pwd
return user.preferences.showOtpAsDot && !reveal ? pwd.replace(/[0-9]/g, '●') : pwd
}