refactor: prefer buffer (#26469)

* refactor: prefer buffer

* Update server/src/schema/tables/session.table.ts

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>

---------

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
This commit is contained in:
Jason Rasmussen
2026-02-24 08:26:36 -05:00
committed by GitHub
parent 4b8f90aa55
commit f07e2b58f0
16 changed files with 44 additions and 29 deletions
@@ -31,7 +31,7 @@ export class ApiKeyRepository {
}
@GenerateSql({ params: [DummyValue.STRING] })
getKey(hashedToken: string) {
getKey(hashedToken: Buffer) {
return this.db
.selectFrom('api_key')
.select((eb) => [
+1 -1
View File
@@ -23,7 +23,7 @@ export class CryptoRepository {
}
hashSha256(value: string) {
return createHash('sha256').update(value).digest('base64');
return createHash('sha256').update(value).digest();
}
verifySha256(value: string, encryptedValue: string, publicKey: string) {
@@ -48,7 +48,7 @@ export class SessionRepository {
}
@GenerateSql({ params: [DummyValue.STRING] })
getByToken(token: string) {
getByToken(token: Buffer) {
return this.db
.selectFrom('session')
.select((eb) => [