-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/login page #48
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,167 @@ | ||||||||||||||||||||||||||||||
| import React, { useState } from "react"; | ||||||||||||||||||||||||||||||
| import { Link } from "react-router-dom"; | ||||||||||||||||||||||||||||||
| import { LogIn, UserPlus, Eye, EyeOff } from "lucide-react"; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const LoginPage: React.FC = () => { | ||||||||||||||||||||||||||||||
| const [isLogin, setIsLogin] = useState(true); | ||||||||||||||||||||||||||||||
| const [firstName, setFirstName] = useState(""); | ||||||||||||||||||||||||||||||
| const [email, setEmail] = useState(""); | ||||||||||||||||||||||||||||||
| const [password, setPassword] = useState(""); | ||||||||||||||||||||||||||||||
| const [confirmPassword, setConfirmPassword] = useState(""); | ||||||||||||||||||||||||||||||
| const [showPassword, setShowPassword] = useState(false); | ||||||||||||||||||||||||||||||
| const [showConfirmPassword, setShowConfirmPassword] = useState(false); | ||||||||||||||||||||||||||||||
| const passwordsMatch = isLogin || !confirmPassword || password === confirmPassword; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const handleSubmit = (e: React.FormEvent) => { | ||||||||||||||||||||||||||||||
| e.preventDefault(); | ||||||||||||||||||||||||||||||
| if (isLogin) { | ||||||||||||||||||||||||||||||
| console.log("Login attempt:", { email, password }); | ||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||
| if (password !== confirmPassword) { | ||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| console.log("Register attempt:", { firstName, email, password, confirmPassword }); | ||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+24
|
||||||||||||||||||||||||||||||
| console.log("Login attempt:", { email, password }); | |
| } else { | |
| if (password !== confirmPassword) { | |
| return; | |
| } | |
| console.log("Register attempt:", { firstName, email, password, confirmPassword }); | |
| console.log("Login attempt:", { email }); | |
| } else { | |
| if (password !== confirmPassword) { | |
| return; | |
| } | |
| console.log("Register attempt:", { firstName, email }); |
Copilot
AI
Feb 17, 2026
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 link points to /password_reset, which is an inconsistent path style compared to the other routes. If the route is renamed to match the app's convention (e.g., /password-reset), update this to value as well.
| <Link to="/password_reset" className="text-xs text-indigo-400 hover:text-indigo-300 transition-colors"> | |
| <Link to="/password-reset" className="text-xs text-indigo-400 hover:text-indigo-300 transition-colors"> |
Copilot
AI
Feb 17, 2026
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.
The show/hide password toggle button is icon-only and lacks an accessible name. Add an aria-label (e.g., "Mostrar senha" / "Ocultar senha") and consider aria-pressed to convey state to screen readers.
| className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-indigo-400 transition-colors" | |
| className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-indigo-400 transition-colors" | |
| aria-label={showPassword ? "Ocultar senha" : "Mostrar senha"} | |
| aria-pressed={showPassword} |
Copilot
AI
Feb 17, 2026
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.
The show/hide confirm password toggle button is icon-only and lacks an accessible name. Add an aria-label (e.g., "Mostrar confirmação de senha" / "Ocultar confirmação de senha") and consider aria-pressed to convey state.
| className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-indigo-400 transition-colors" | |
| className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-indigo-400 transition-colors" | |
| aria-label={showConfirmPassword ? "Ocultar confirmação de senha" : "Mostrar confirmação de senha"} | |
| aria-pressed={showConfirmPassword} |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,90 @@ | ||||||||||
| import React, { useState } from "react"; | ||||||||||
| import { ArrowLeft, Mail, CheckCircle } from "lucide-react"; | ||||||||||
| import { Link } from "react-router-dom"; | ||||||||||
|
|
||||||||||
| const PasswordResetPage: React.FC = () => { | ||||||||||
| const [email, setEmail] = useState(""); | ||||||||||
| const [isSubmitted, setIsSubmitted] = useState(false); | ||||||||||
|
|
||||||||||
| const handleSubmit = (e: React.FormEvent) => { | ||||||||||
| e.preventDefault(); | ||||||||||
| // logica de envio de email de recuperacao | ||||||||||
|
||||||||||
| // logica de envio de email de recuperacao | |
| // lógica de envio de e-mail de recuperação |
Copilot
AI
Feb 17, 2026
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.
The password reset submit handler logs the entered email. Even though it's not a password, it's still user PII and shouldn't be written to the console in production. Please remove the console.log (or replace with a non-PII debug log gated to development).
| console.log("Reset password attempt:", { email }); | |
| if (process.env.NODE_ENV === "development") { | |
| console.log("Reset password attempt submitted"); | |
| } |
Copilot
AI
Feb 17, 2026
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.
PR description mentions success/error feedback using react-toastify, but this page currently only toggles local isSubmitted state and doesn't surface any success/error toast or handle request failures. Please either implement toast notifications around the reset request (success + error paths) or adjust the PR description to match the current behavior.
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.
Route paths in this app are otherwise lowercase without underscores (e.g.,
/login,/configure,/documentation). Using/password_resetintroduces an inconsistent URL pattern; consider renaming to a hyphenated path like/password-reset(and update anyLinktargets accordingly).