BLOG-136 Dashboard route and frontend authentication #137
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLOG-136_create_dashboard_route"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Package Changes
Screenshots
Reference
Resolves #136.
Checklist
/improve
PR Code Suggestions ✨
Correct Zod integer validation
The
z.int32()
validator is not a standard Zod type and will likely cause runtimeerrors during schema parsing. Zod typically uses
z.number().int()
for integervalidation.
frontend/src/lib/auth/adapter/gateway/userResponseDto.ts [4-8]
Suggestion importance[1-10]: 9
__
Why: The
z.int32()
method is not a standard Zod validator and would cause runtime errors. Replacing it withz.number().int()
correctly validates integers, preventing potential bugs.Handle unhandled event types
The
dispatch
method implicitly returnsundefined
if anAuthEvent
other thanCurrentUserLoadedEvent
is dispatched, which violates itsPromise
return type. Add adefault case to handle unknown event types, ensuring a consistent return or error.
frontend/src/lib/auth/adapter/presenter/authBloc.ts [30-33]
Suggestion importance[1-10]: 8
__
Why: The
dispatch
method's return typePromise<AuthState>
is not guaranteed if an unhandledAuthEvent
occurs, leading to a potential runtime error. Adding adefault
case with an error throw ensures type consistency and robust error handling.Ignore bot's comments.