-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OV-2: FEAT: Sign-in flow #17
Conversation
@@ -9,8 +9,13 @@ class UserRepository implements Repository { | |||
this.userModel = userModel; | |||
} | |||
|
|||
public find(): ReturnType<Repository['find']> { | |||
return Promise.resolve(null); | |||
public async find(payload: string | number): Promise<UserEntity | null> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find method should only find by id.
Please create a specific method if you want to use different fields
for example findByEmail()
@@ -1,6 +1,7 @@ | |||
type Repository<T = unknown> = { | |||
find(): Promise<T>; | |||
findAll(): Promise<T[]>; | |||
findByEmail(email: string): Promise<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will have this method only in user repo so there is no need to put this in type here
@@ -3,6 +3,7 @@ type Service<T = unknown> = { | |||
findAll(): Promise<{ | |||
items: T[]; | |||
}>; | |||
findByEmail(email: string): Promise<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -65,6 +83,17 @@ class AuthController extends BaseController { | |||
* type: object | |||
* $ref: '#/components/schemas/User' | |||
*/ | |||
private async signIn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should add js doc for endpoint
Add sign-in functionality from the backend. A data transfer object containing user credentials (email, password) is used to compare against existing data