Making uid more compatible
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
9674807093
commit
25f2bd2ae4
|
@ -38,6 +38,7 @@ V1.post("/db/:database/query", async (ctx) => {
|
|||
|
||||
if (authkey && db.publickey) {
|
||||
let res = await verifyJWT(authkey, db.publickey);
|
||||
if (res && !res.uid && res.user) res.uid = res.user;
|
||||
if (!res || !res.uid) {
|
||||
throw new BadRequestError("Invalid JWT");
|
||||
} else {
|
||||
|
|
|
@ -55,6 +55,7 @@ export class WebsocketConnectionManager {
|
|||
const authkey = query.get("authkey");
|
||||
if (authkey && db.publickey) {
|
||||
let res = await verifyJWT(authkey, db.publickey);
|
||||
if (res && !res.uid && res.user) res.uid = res.user;
|
||||
if (!res || !res.uid) {
|
||||
sendError("Invalid JWT");
|
||||
socket.close();
|
||||
|
|
Reference in New Issue