GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Rewrites the authorization header to the correct private key

parent 7901542d
......@@ -34,6 +34,7 @@ export async function roleAuthorizationChecker(action: Action, searchRoles: User
if (typeof decodedToken !== 'object' || !(decodedToken as any).name) {
return false;
}
action.request.headers.authorization = (decodedToken as any).privateKey;
return (searchRoles as unknown as Array<string>).some(role => (decodedToken as any).userAuthorizations.includes(UserRole[role]));
}
......
......@@ -587,9 +587,6 @@ export class QuizRouter extends AbstractRouter {
if (!quiz) {
throw new BadRequestError(MessageProtocol.InvalidParameters);
}
if (privateKey.match(/bearer .*/i)) {
privateKey = (AuthService.decodeToken(privateKey.substr(7)) as any).privateKey;
}
const existingQuiz = await QuizDAO.getQuizByName(quiz.name);
if (existingQuiz && existingQuiz.privateKey !== privateKey) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment