Skip to content
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

Merged
merged 19 commits into from
Aug 21, 2024
Merged

OV-2: FEAT: Sign-in flow #17

merged 19 commits into from
Aug 21, 2024

Conversation

JKaypa
Copy link
Collaborator

@JKaypa JKaypa commented Aug 19, 2024

Add sign-in functionality from the backend. A data transfer object containing user credentials (email, password) is used to compare against existing data

@JKaypa JKaypa added the BE Backend feature label Aug 19, 2024
@JKaypa JKaypa added this to the Release 1.0 milestone Aug 19, 2024
@JKaypa JKaypa self-assigned this Aug 19, 2024
@JKaypa JKaypa linked an issue Aug 19, 2024 that may be closed by this pull request
7 tasks
@@ -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> {
Copy link
Collaborator

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>;
Copy link
Collaborator

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>;
Copy link
Collaborator

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(
Copy link
Collaborator

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

@JKaypa JKaypa requested a review from nikita-remeslov August 20, 2024 18:30
@JKaypa JKaypa linked an issue Aug 20, 2024 that may be closed by this pull request
5 tasks
@nikita-remeslov nikita-remeslov merged commit f254c30 into next Aug 21, 2024
2 checks passed
@nikita-remeslov nikita-remeslov deleted the task/OV-2-add-sign-in-flow branch August 21, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE Backend feature
Projects
Status: To Be Tested
Development

Successfully merging this pull request may close these issues.

FEAT: Swagger API documentation FEAT: Sign-in flow
3 participants