mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 22:51:17 +08:00
fix: improper 500 in wisp token verify
This commit is contained in:
parent
7aa886d573
commit
75aaaa66a8
@ -57,10 +57,17 @@ class WispService extends BaseService {
|
|||||||
const svc_apiError = this.services.get('api-error');
|
const svc_apiError = this.services.get('api-error');
|
||||||
const svc_event = this.services.get('event');
|
const svc_event = this.services.get('event');
|
||||||
|
|
||||||
const decoded = svc_token.verify('wisp', req.body.token);
|
const decoded = (() => {
|
||||||
if ( decoded.$ !== 'token:wisp' ) {
|
try {
|
||||||
throw svc_apiError.create('invalid_token');
|
const decoded = svc_token.verify('wisp', req.body.token);
|
||||||
}
|
if ( decoded.$ !== 'token:wisp' ) {
|
||||||
|
throw svc_apiError.create('invalid_token');
|
||||||
|
}
|
||||||
|
return decoded;
|
||||||
|
} catch (e) {
|
||||||
|
throw svc_apiError.create('forbidden');
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
const svc_getUser = this.services.get('get-user');
|
const svc_getUser = this.services.get('get-user');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user