mirror of
https://github.com/standardnotes/server
synced 2026-01-16 20:04:32 -05:00
chore: release latest code (#1075)
This commit is contained in:
@@ -52,9 +52,22 @@ export class SettingCrypter implements SettingCrypterInterface {
|
||||
throw new Error(`Could not find user with uuid: ${userUuid.value}`)
|
||||
}
|
||||
|
||||
if (!this.isValidJSONSubjectForDecryption(value)) {
|
||||
return value
|
||||
}
|
||||
|
||||
return this.crypter.decryptForUser(value, user)
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
private isValidJSONSubjectForDecryption(value: string): boolean {
|
||||
try {
|
||||
JSON.parse(value)
|
||||
return true
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user