default to only jwt checking (empty @Authorized() )

ref #6
This commit is contained in:
Philipp Dormann 2020-11-27 21:18:42 +01:00
parent 5f4aed2f02
commit 37baa4ea45
1 changed files with 7 additions and 1 deletions

View File

@ -40,6 +40,12 @@ const authchecker = async (action: Action, permissions: string | string[]) => {
} else {
throw new HttpError(403, "no")
}
return true;
//
try {
jwt.verify(provided_token, process.env.JWT_SECRET || "secretjwtsecret");
return true
} catch (error) {
return false
}
}
export default authchecker