cuappdev / cuappdev/resell-backend

Create @Authorized decorator

Open
#55 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

- Separate what `@CurrentUser` and `@Authorized` does
- `@CurrentUser` returns a `UserModel` if it exists, `undefined` otherwise
- `@Authorized` does nothing if user is authorized, returns an Unauthorized exception otherwise
- `@Authorized` follows this: https://github.com/typestack/routing-controllers#authorized-decorator
- Potentially make an `@OptionalAuthorized` middleware as well

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.