-
Notifications
You must be signed in to change notification settings - Fork 0
132 security dialog #155
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?
132 security dialog #155
Conversation
|
@greptile |
Greptile OverviewGreptile SummaryThis PR implements a security settings dialog with password change functionality, session management, and logout features. The implementation adds a complete UI for security controls within the settings dialog. Key changes:
Issues found:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| src/components/settings/pages/security-settings-content.tsx | Implemented security settings UI with password change and session management. Has auth client instantiation issue and missing input validation. |
| src/components/settings/settings-dialog.tsx | Changed overflow behavior from overflow-hidden to overflow-y-auto to fix dialog scrolling. |
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.
2 files reviewed, 3 comments
| const [loading, setLoading] = useState(false); | ||
| const [message, setMessage] = useState<{ type: 'success' | 'error'; text: string } | null>(null); | ||
|
|
||
| const authClient = createAuthClient() |
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.
Creates a new auth client instance on every render. Move outside component or memoize.
| const authClient = createAuthClient() | |
| const authClient = React.useMemo(() => createAuthClient(), []); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/settings/pages/security-settings-content.tsx
Line: 20:20
Comment:
Creates a new auth client instance on every render. Move outside component or memoize.
```suggestion
const authClient = React.useMemo(() => createAuthClient(), []);
```
How can I resolve this? If you propose a fix, please make it concise.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.
Yeah this is really important, you should just import it from where greptile mentioned
| @@ -1,3 +1,188 @@ | |||
| import React, { useState } from 'react'; | |||
| import { createAuthClient } from 'better-auth/client'; | |||
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.
Importing from better-auth/client but existing codebase uses better-auth/react (see src/lib/auth/client.ts:3). Use the shared authClient from @/lib/auth/client instead of creating a new instance.
| import { createAuthClient } from 'better-auth/client'; | |
| import { authClient } from '@/lib/auth/client'; |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/settings/pages/security-settings-content.tsx
Line: 2:2
Comment:
Importing from `better-auth/client` but existing codebase uses `better-auth/react` (see `src/lib/auth/client.ts:3`). Use the shared `authClient` from `@/lib/auth/client` instead of creating a new instance.
```suggestion
import { authClient } from '@/lib/auth/client';
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| disabled={loading} | ||
| /> | ||
| </div> | ||
| <Button onClick={handleChangePassword} disabled={loading}> |
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.
Button is not disabled when required fields are empty. Users can submit with empty passwords.
| <Button onClick={handleChangePassword} disabled={loading}> | |
| <Button onClick={handleChangePassword} disabled={loading || !currentPassword || !newPassword || !confirmPassword}> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/settings/pages/security-settings-content.tsx
Line: 128:128
Comment:
Button is not disabled when required fields are empty. Users can submit with empty passwords.
```suggestion
<Button onClick={handleChangePassword} disabled={loading || !currentPassword || !newPassword || !confirmPassword}>
```
How can I resolve this? If you propose a fix, please make it concise.
theosiemensrhodes
left a comment
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.
Looks mostly good just fix the comments
| <div className="space-y-4"> | ||
| <div className="space-y-2"> | ||
| <Label htmlFor="current-password">Current Password</Label> | ||
| <Input |
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 have a way to do forms that isn't manual. See the login and signup pages for examples.
| const [loading, setLoading] = useState(false); | ||
| const [message, setMessage] = useState<{ type: 'success' | 'error'; text: string } | null>(null); | ||
|
|
||
| const authClient = createAuthClient() |
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.
Yeah this is really important, you should just import it from where greptile mentioned
No description provided.