mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 20:04:26 +00:00
feat(api-token): store API tokens as SHA-256 hashes (#492)
New tokens are 32 random bytes with a shumai_ prefix and are returned only once at creation. The list endpoint returns a 4-character hint instead of the plaintext. A migration hashes existing tokens in place so they keep authenticating.
This commit is contained in:
@@ -706,7 +706,8 @@ export type CollectionScalarFieldEnum = (typeof CollectionScalarFieldEnum)[keyof
|
||||
|
||||
export const ApiTokenScalarFieldEnum = {
|
||||
id: 'id',
|
||||
token: 'token',
|
||||
tokenHash: 'tokenHash',
|
||||
tokenHint: 'tokenHint',
|
||||
name: 'name',
|
||||
userId: 'userId',
|
||||
createdAt: 'createdAt',
|
||||
|
||||
Reference in New Issue
Block a user