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 login page #155

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Conversation

roshni73
Copy link
Collaborator

@roshni73 roshni73 commented Oct 18, 2024

Addresses:

Changes

  • Add login page

This PR doesn't introduce:

  • typos
  • conflict markers
  • unwanted comments
  • temporary files, auto-generated files or secret keys
  • console.log meant for debugging
  • codegen errors

Comment on lines 91 to 104
const selectedUser = usersData[0];
setUser({
id: selectedUser.id,
username: selectedUser.username,
firstName: selectedUser.first ?? undefined,
lastName: selectedUser.last ?? undefined,
displayName: getUserName({
first_name: selectedUser.first,
last_name: selectedUser.last,
username: selectedUser.username,
}),
token: selectedUser.token,
expires: selectedUser.expires,
});
Copy link
Member

Choose a reason for hiding this comment

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

This should be done after the request is submitted. Let me know if a call is necessary.

Comment on lines 38 to 57
const usersData = [
{
id: 1,
username: 'johndoe',
password: 'password123',
first: 'John',
last: 'Doe',
token: 'dummyToken123',
expires: '2024-12-31T23:59:59Z',
},
{
id: 2,
username: 'janedoe',
password: 'password456',
first: 'Jane',
last: 'Doe',
token: 'dummyToken456',
expires: '2025-01-31T23:59:59Z',
},
];
Copy link
Member

Choose a reason for hiding this comment

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

We don't need 2 users.

Comment on lines 40 to 46
id: 1,
username: 'johndoe',
password: 'password123',
first: 'John',
last: 'Doe',
token: 'dummyToken123',
expires: '2024-12-31T23:59:59Z',
Copy link
Member

Choose a reason for hiding this comment

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

This should follow the user type defined in domain

Comment on lines 110 to 112
const handleCaptchaVerify = (token: string) => {
setCaptchaToken(token);
};
Copy link
Member

Choose a reason for hiding this comment

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

setCaptchaToken can be directly set in the input

</div>
<div className={styles.actions}>
<HCaptcha
sitekey="10000000-ffff-ffff-ffff-000000000001"
Copy link
Member

Choose a reason for hiding this comment

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

fetch this from environment.

@AdityaKhatri AdityaKhatri changed the base branch from develop to project/phase-2-dummy-pages October 29, 2024 10:41
Comment on lines 68 to 74
{/* <Button
name={undefined}
variant="primary"
onClick={undefined}
>
{strings.appLogin}
</Button>
</Button> */}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove unwanted comments.

"loginTitle":"IFRC GO - Login",
"loginHeader":"Login",
"loginSubHeader":"If you are staff, member or volunteer of the Red Cross Red Crescent Movement (National Societies, the IFRC and the ICRC) login with you email and password.",
"loginEmailUsername":"Email/Username",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use only Email

Suggested change
"loginEmailUsername":"Email/Username",
"loginEmailUsername":"Email/Username",

"loginShowUsernameTitle":"Show me my username",
"loginResendValidation":"Re-send validation email",
"loginResendValidationTitle":"I didn't get my validation email",
"loginForgotUserPass":"Forgot your password/username?",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are only using email

Suggested change
"loginForgotUserPass":"Forgot your password/username?",
"loginForgotUserPass":"Forgot your password?",


const formSchema: FormSchema = {
fields: (): FormSchemaFields => ({
username: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
username: {
email: {

const selectedUser = usersData[0];
setUser({
id: selectedUser.id,
username: selectedUser.username,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove all username

Suggested change
username: selectedUser.username,
username: selectedUser.username,

- Add Captcha for login page
- Fix Hacptcha sitekey
@roshni73 roshni73 marked this pull request as ready for review November 11, 2024 09:09
@barshathakuri barshathakuri merged commit b9aca34 into project/phase-2-dummy-pages Nov 11, 2024
4 checks passed
@barshathakuri barshathakuri deleted the feature/login-page branch November 11, 2024 09:10
barshathakuri added a commit that referenced this pull request Nov 11, 2024
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.

3 participants