feat: Mechanisme voor automatische aanmaak en update van accounts aangemaakt.

This commit is contained in:
Gerald Schmittinger 2025-04-08 14:24:57 +02:00
parent 6cb8a1b98f
commit 9339eca9cf
9 changed files with 84 additions and 23 deletions

View file

@ -36,3 +36,8 @@ export const studentsOnly = authorize((auth) => auth.accountType === 'student');
* Middleware which rejects requests from unauthenticated users or users that aren't teachers.
*/
export const teachersOnly = authorize((auth) => auth.accountType === 'teacher');
/**
* Middleware which is to be used on requests no normal user should be able to execute.
* Since there is no concept of administrator accounts yet, currently, those requests will always be blocked.
*/
export const adminOnly = authorize(() => false);