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

Add signInWithNewPassword GraphQL API #291

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

henry0715-dev
Copy link
Contributor

@henry0715-dev henry0715-dev commented Aug 29, 2024

Close #14

Changed signIn GraphQL API logic.

  • Returns Err if last_signin_time of account is None.

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 97.85714% with 6 lines in your changes missing coverage. Please review.

Project coverage is 69.94%. Comparing base (808a3c9) to head (f59e8ca).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/graphql/account.rs 97.85% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   69.42%   69.94%   +0.52%     
==========================================
  Files          67       67              
  Lines       14037    14274     +237     
==========================================
+ Hits         9745     9984     +239     
+ Misses       4292     4290       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

CHANGELOG.md Outdated
@@ -68,6 +68,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Added a `language` field to the `Account`. Consequently, the `account` and
`accountList` API responses now include this field. The `insertAccount` and
`updateAccount` GraphQL API endpoints are also updated to support the field.
- Added `common_sign-in_logic` to handle `sign-in` GraphQL API logic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary because the method is not for users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll delete it.

src/graphql/account.rs Outdated Show resolved Hide resolved
src/graphql/account.rs Outdated Show resolved Hide resolved
@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch 2 times, most recently from ed652fa to 97ffb90 Compare August 29, 2024 07:08
src/graphql/account.rs Outdated Show resolved Hide resolved
src/graphql/account.rs Outdated Show resolved Hide resolved
@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch 3 times, most recently from a5c9935 to 5548e55 Compare August 30, 2024 05:03
src/graphql/account.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
@@ -68,6 +68,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Added a `language` field to the `Account`. Consequently, the `account` and
`accountList` API responses now include this field. The `insertAccount` and
`updateAccount` GraphQL API endpoints are also updated to support the field.
- Added `signInWithNewPassword` GraphQL API for signing in with a new password.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new API, so should be included in the section "Added".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the signIn has been changed, it should be documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch 2 times, most recently from e72ae31 to 6ebe11b Compare September 2, 2024 01:39
CHANGELOG.md Outdated Show resolved Hide resolved
@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch 2 times, most recently from e4320fd to acbb168 Compare September 2, 2024 02:41
@sehkone
Copy link
Contributor

sehkone commented Sep 2, 2024

When reseting the admin's password, we need to reset the last_signin_time as well.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch 2 times, most recently from fb6cc77 to 17d7dc0 Compare September 3, 2024 06:18
src/graphql/account.rs Outdated Show resolved Hide resolved
src/graphql/account.rs Outdated Show resolved Hide resolved
src/graphql/account.rs Outdated Show resolved Hide resolved
@sophie-cluml
Copy link
Contributor

@sehkone I know we are still in pr-review stage for this PR, but I think merging PR would require implement new UX flow and design in the client side. So I would like to suggest in advance, that we might merge this PR after we release the upcoming review-web version.

@sehkone
Copy link
Contributor

sehkone commented Sep 3, 2024

@sehkone I know we are still in pr-review stage for this PR, but I think merging PR would require implement new UX flow and design in the client side. So I would like to suggest in advance, that we might merge this PR after we release the upcoming review-web version.

Yes. I won't merge this until what is required is done.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from 17d7dc0 to 8912b70 Compare September 4, 2024 00:05
@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from 8912b70 to a743b94 Compare September 4, 2024 05:01
CHANGELOG.md Outdated
Comment on lines 10 to 17
### Added

- Added `signInWithNewPassword` GraphQL API for signing in with a new password.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henry0715-dev,

Could you take a look at this? It indicates that unnecessary spaces are included, which suggests you may need to check your editor setup, as VS Code shouldn't have done this if it were set up properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed the modification.
Thank you.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from f6c36ab to 29f4dfd Compare October 30, 2024 22:38
@henry0715-dev henry0715-dev requested a review from sehkone October 30, 2024 22:39
Copy link
Contributor

@sophie-cluml sophie-cluml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to ask you for a rebase please.

src/graphql/account.rs Outdated Show resolved Hide resolved
///
/// Returns `Err` if the password or the new password are invalid, the access
/// doesn't originate from a permitted IP address, or the number of sessions exceeds the
/// maximum limit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we only need a single space?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modification completed.

src/graphql/account.rs Outdated Show resolved Hide resolved
@sophie-cluml
Copy link
Contributor

Thank you for your kindness in describing your PR. I would like to suggest a small update to align with our convention. Please consider changing

Changed sign-in GraphQL API logic.

to

  • Changed signIn GraphQL API logic.

### Added

- Added `signInWithNewPassword` GraphQL API for signing in with a new password.

### Changed

Copy link
Contributor

@sophie-cluml sophie-cluml Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line with this comment, I noticed that the signIn API logic has been modified. As this logic impacts end users, I think it seems beneficial to explicitly include this change in the changelog to keep our users informed. I’d like to suggest adding a line in the Changed section, perhaps like the following:

  • The signIn GraphQL API now returns an error if the account was never signed in before. This change is part of enhancing account security by requiring all users to update their passwords upon their first signing in.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from 29f4dfd to f08c5ef Compare October 31, 2024 23:41
@sehkone
Copy link
Contributor

sehkone commented Oct 31, 2024

I'd like to ask you for a rebase please.

@sophie-cluml,

I don't see any conflicts with the main branch. Why would you think this needs a rebase?

@sehkone
Copy link
Contributor

sehkone commented Oct 31, 2024

Thank you for your kindness in describing your PR. I would like to suggest a small update to align with our convention. Please consider changing

Changed sign-in GraphQL API logic.

to

  • Changed signIn GraphQL API logic.

The representation, such as signIn, is not merely conventional. Since it is defined in the schema, we must use it as is.

@sehkone
Copy link
Contributor

sehkone commented Nov 1, 2024

Thank you for your kindness in describing your PR. I would like to suggest a small update to align with our convention. Please consider changing

Changed sign-in GraphQL API logic.

to

  • Changed signIn GraphQL API logic.

The representation, such as signIn, is not merely conventional. Since it is defined in the schema, we must use it as is.

One more thing: backticks should be used to quote elements that belong to another context. When we search for a quoted string in the original text, it must appear exactly as quoted. There is no sign-in in our codebase. Across the code and the UI, we only have two representations: sign_in and signIn.

@henry0715-dev
Copy link
Contributor Author

I'd like to ask you for a rebase please.

@sophie-cluml,

I don't see any conflicts with the main branch. Why would you think this needs a rebase?

When I commented, it was conflicting.
Currently, rebase is applied.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from f08c5ef to 01e777c Compare November 1, 2024 00:11
@henry0715-dev
Copy link
Contributor Author

Thank you for your kindness in describing your PR. I would like to suggest a small update to align with our convention. Please consider changing

Changed sign-in GraphQL API logic.

to

  • Changed signIn GraphQL API logic.

The representation, such as signIn, is not merely conventional. Since it is defined in the schema, we must use it as is.

One more thing: backticks should be used to quote elements that belong to another context. When we search for a quoted string in the original text, it must appear exactly as quoted. There is no sign-in in our codebase. Across the code and the UI, we only have two representations: sign_in and signIn.

Commit message modification completed.
Thank you.

@sehkone
Copy link
Contributor

sehkone commented Nov 1, 2024

Thank you for your kindness in describing your PR. I would like to suggest a small update to align with our convention. Please consider changing

Changed sign-in GraphQL API logic.

to

  • Changed signIn GraphQL API logic.

The representation, such as signIn, is not merely conventional. Since it is defined in the schema, we must use it as is.

One more thing: backticks should be used to quote elements that belong to another context. When we search for a quoted string in the original text, it must appear exactly as quoted. There is no sign-in in our codebase. Across the code and the UI, we only have two representations: sign_in and signIn.

Commit message modification completed. Thank you.

To clarify further: while backticks are typically used to quote code elements, they can also be applied to any string that might or will appear in a code context. In other words, backticks doesn’t necessarily imply that the enclosed string must be searchable. However, in this CHANGELOG.md, it’s assumed that it should be searchable.

@henry0715-dev
Copy link
Contributor Author

Thank you for your kindness in describing your PR. I would like to suggest a small update to align with our convention. Please consider changing

Changed sign-in GraphQL API logic.

to

  • Changed signIn GraphQL API logic.

The representation, such as signIn, is not merely conventional. Since it is defined in the schema, we must use it as is.

One more thing: backticks should be used to quote elements that belong to another context. When we search for a quoted string in the original text, it must appear exactly as quoted. There is no sign-in in our codebase. Across the code and the UI, we only have two representations: sign_in and signIn.

Commit message modification completed. Thank you.

To clarify further: while backticks are typically used to quote code elements, they can also be applied to any string that might or will appear in a code context. In other words, backticks doesn’t necessarily imply that the enclosed string must be searchable. However, in this CHANGELOG.md, it’s assumed that it should be searchable.

Thanks for the detailed explanation and guide.
I will be careful with backticks and naming.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from 01e777c to 389bd6c Compare November 7, 2024 07:33
CHANGELOG.md Outdated
### Added

- Added `signInWithNewPassword` GraphQL API for signing in with a new password.
- The `signIn` GraphQL API now returns an error if the account was never signed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to break the line before the word "signed". Could you check your IDE settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked for modification using the cmd + q command in the VSCode IDE.
thank you.

@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from 389bd6c to 16a9872 Compare November 13, 2024 00:26
@sophie-cluml
Copy link
Contributor

Could you rebase please?

@sehkone sehkone mentioned this pull request Nov 13, 2024
Close #14

Changed `signIn` GraphQL API logic.
- Returns `Err` if `last_signin_time` of `account` is `None`.
@henry0715-dev henry0715-dev force-pushed the henry/sign-in-with-new-password branch from 16a9872 to f59e8ca Compare November 13, 2024 03:52
@henry0715-dev
Copy link
Contributor Author

Could you rebase please?
It's done.

@sehkone sehkone merged commit 2b008be into main Nov 15, 2024
10 checks passed
@sehkone sehkone deleted the henry/sign-in-with-new-password branch November 15, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

첫 로그인 시 계정 비밀번호 변경을 위한 새로운 GraphQL mutation 구현
4 participants