-
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
Sign-up Page Functionality #202
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
42a9f9b
Copied over changes, nuked old Signup page
kevin-pierce 4e81496
Not invited error message
kevin-pierce 6f174a0
Email already in use error
kevin-pierce bf28a14
Finalized fixes
kevin-pierce 87bea47
Merge remote-tracking branch 'origin/main' into kevin-signup-function…
kevin-pierce ae7c384
Now displays invlaid email error FIRST
kevin-pierce 2046276
Combined auth error message generator, removed redundant type
kevin-pierce c16dbcf
Fixed password issue
kevin-pierce fb2dcf3
Merge remote-tracking branch 'origin/main' into kevin-signup-function…
kevin-pierce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class UserNotInvitedException(Exception): | ||
""" | ||
Raised when a user that has not been invited attempts to register | ||
""" | ||
|
||
def __init__(self): | ||
self.message = "This email address has not been invited. Please try again with a different email." | ||
super().__init__(self.message) | ||
|
||
class EmailAlreadyInUseException(Exception): | ||
""" | ||
Raised when a user attempts to register with an email of a previously activated user | ||
""" | ||
|
||
def __init__(self): | ||
self.message = "This email is already in use. Please try again with a different email." | ||
super().__init__(self.message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import { HOME_PAGE, SIGNUP_PAGE } from "../../constants/Routes"; | |
import AuthContext from "../../contexts/AuthContext"; | ||
import { ErrorResponse, AuthTokenResponse } from "../../types/AuthTypes"; | ||
import commonApiClient from "../../APIClients/CommonAPIClient"; | ||
import { isAuthErrorResponse } from "../../helper/authError"; | ||
|
||
type CredentialsProps = { | ||
email: string; | ||
|
@@ -26,12 +27,6 @@ type CredentialsProps = { | |
setToggle: (toggle: boolean) => void; | ||
}; | ||
|
||
const isLoginErrorResponse = ( | ||
res: AuthTokenResponse | ErrorResponse, | ||
): res is ErrorResponse => { | ||
return res !== null && "errCode" in res; | ||
}; | ||
|
||
Comment on lines
-29
to
-34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a more comprehensive version of this function |
||
const Login = ({ | ||
email, | ||
setEmail, | ||
|
@@ -77,11 +72,11 @@ const Login = ({ | |
const onLogInClick = async () => { | ||
setLoginClicked(true); | ||
const isInvited = await commonApiClient.isUserInvited(email); | ||
if (isInvited) { | ||
if (isInvited !== "Not Invited") { | ||
const loginResponse: | ||
| AuthTokenResponse | ||
| ErrorResponse = await authAPIClient.login(email, password); | ||
if (isLoginErrorResponse(loginResponse)) { | ||
if (isAuthErrorResponse(loginResponse)) { | ||
setPasswordError(true); | ||
setPasswordErrStr(loginResponse.errMessage); | ||
} else if (loginResponse) { | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure if this needs to be addressed in this PR, but I was trying to sign up with an account that is "Invited" but clicking "Create Account" didn't do anything. I looked in the networks tab and found that the register endpoint failed with the error: "Invalid password string. Password must be a string at least 6 characters long." This could be unintuitive for the users since it didn't show an error box so they don't know that this password character limit exists.
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.
Resolved ; I approached this by offloading the password verification to the frontend (by simply doing a length check to verify the password is >= 6 characters long). This check is performed both in the onClick handler for createAccount and within the handlePasswordChange function (which functions the same way as the valid email error does, in which we only check for the validity of these fields after the create account button has been clicked)