fix: security hardening + code quality improvements (401 retry limit, UUID crypto, debounce this-bug, deduplicate CSS/helpers, optimize SW precache)
This commit is contained in:
@@ -18,14 +18,13 @@ class ConversationsService {
|
||||
return this.hashPublicKey(publicKey)
|
||||
}
|
||||
|
||||
hashPublicKey(publicKey) {
|
||||
async hashPublicKey(publicKey) {
|
||||
const encoder = new TextEncoder()
|
||||
const data = encoder.encode(publicKey)
|
||||
return crypto.subtle.digest('SHA-256', data).then(hash => {
|
||||
return Array.from(new Uint8Array(hash))
|
||||
.map(b => b.toString(16).padStart(2, '0'))
|
||||
.join('')
|
||||
})
|
||||
const hash = await crypto.subtle.digest('SHA-256', data)
|
||||
return Array.from(new Uint8Array(hash))
|
||||
.map(b => b.toString(16).padStart(2, '0'))
|
||||
.join('')
|
||||
}
|
||||
|
||||
async getMyConversations() {
|
||||
|
||||
Reference in New Issue
Block a user