Fix Token API compatibility

This commit is contained in:
2026-07-22 22:30:26 -04:00
parent 1ef868e23c
commit e910a492ba
3 changed files with 25 additions and 3 deletions
+15
View File
@@ -21,6 +21,21 @@ class Token extends Model {
return false
}
}
static async get(pk, ...args) {
const result = await super.get(pk, ...args);
if (!result) {
const error = new Error('EntryNotFound');
error.name = 'EntryNotFound';
error.status = 404;
throw error;
}
return result;
}
async remove() {
return this.delete();
}
}
class AuthToken extends Token{