-
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
Add login page #155
Add login page #155
Conversation
0c038e4
to
04ae36b
Compare
src/views/Login/index.tsx
Outdated
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, | ||
}); |
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.
This should be done after the request is submitted. Let me know if a call is necessary.
src/views/Login/index.tsx
Outdated
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', | ||
}, | ||
]; |
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 don't need 2 users.
src/views/Login/index.tsx
Outdated
id: 1, | ||
username: 'johndoe', | ||
password: 'password123', | ||
first: 'John', | ||
last: 'Doe', | ||
token: 'dummyToken123', | ||
expires: '2024-12-31T23:59:59Z', |
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.
This should follow the user type defined in domain
src/views/Login/index.tsx
Outdated
const handleCaptchaVerify = (token: string) => { | ||
setCaptchaToken(token); | ||
}; |
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.
setCaptchaToken can be directly set in the input
src/views/Login/index.tsx
Outdated
</div> | ||
<div className={styles.actions}> | ||
<HCaptcha | ||
sitekey="10000000-ffff-ffff-ffff-000000000001" |
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.
fetch this from environment.
src/components/Navbar/index.tsx
Outdated
{/* <Button | ||
name={undefined} | ||
variant="primary" | ||
onClick={undefined} | ||
> | ||
{strings.appLogin} | ||
</Button> | ||
</Button> */} |
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.
Please remove unwanted comments.
src/views/Login/i18n.json
Outdated
"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", |
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.
Use only Email
"loginEmailUsername":"Email/Username", | |
"loginEmailUsername":"Email/Username", |
src/views/Login/i18n.json
Outdated
"loginShowUsernameTitle":"Show me my username", | ||
"loginResendValidation":"Re-send validation email", | ||
"loginResendValidationTitle":"I didn't get my validation email", | ||
"loginForgotUserPass":"Forgot your password/username?", |
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 are only using email
"loginForgotUserPass":"Forgot your password/username?", | |
"loginForgotUserPass":"Forgot your password?", |
src/views/Login/index.tsx
Outdated
|
||
const formSchema: FormSchema = { | ||
fields: (): FormSchemaFields => ({ | ||
username: { |
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.
username: { | |
email: { |
src/views/Login/index.tsx
Outdated
const selectedUser = usersData[0]; | ||
setUser({ | ||
id: selectedUser.id, | ||
username: selectedUser.username, |
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.
Remove all username
username: selectedUser.username, | |
username: selectedUser.username, |
74a8511
to
38a60a6
Compare
38a60a6
to
b338975
Compare
b338975
to
f737bee
Compare
f737bee
to
3868bbc
Compare
3868bbc
to
59576f2
Compare
59576f2
to
0e946bf
Compare
- Add Captcha for login page - Fix Hacptcha sitekey
0e946bf
to
728628e
Compare
Addresses:
Changes
This PR doesn't introduce:
console.log
meant for debugging