Skip to content

Commit

Permalink
remove password from user
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Jan 15, 2024
1 parent 5ea9c74 commit e1bed6c
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 137 deletions.
2 changes: 0 additions & 2 deletions src/contexts/UserContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ const UserContextProvider = ({ children }: Props) => {

const handleLogin = async (props: { email: string; code: string }) => {
const response = await AuthService.login(props);
console.log({ response });

setUser(response.data);
StorageService.setUser(response.data);
StorageService.setAccessToken(response.headers.token || '');
Expand Down
107 changes: 0 additions & 107 deletions src/pages/Settings/ChangePassword/index.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions src/pages/Settings/Users/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,6 @@ const UserForm: React.FC<Props> = ({ defaultValues, handleSubmitForm, handleClos
)}
/>

{defaultValues && !('id' in defaultValues) && (
<>
<FormLabel htmlFor="name" style={{ marginTop: '8px' }}>
{t('settings.tabs.users.form.password')}
</FormLabel>
<Controller
rules={{ required: true }}
control={control}
name="password"
render={({ field, fieldState }) => (
<Input
id="password"
type="password"
{...field}
value={field.value}
isInvalid={!!fieldState.error}
/>
)}
/>
</>
)}

<FormLabel htmlFor="name" style={{ marginTop: '8px' }}>
{t('settings.tabs.users.form.role')}
</FormLabel>
Expand Down
5 changes: 0 additions & 5 deletions src/pages/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ const SettingsPage: React.FC = () => {
icon: 'user-circle',
component: <EditUser />,
},
{
label: t('settings.tabs.change-password.title'),
icon: 'lock',
component: <ChangePassword />,
},
...(user?.role === 'admin'
? [
{
Expand Down
1 change: 0 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export interface IUser {
region_id?: string;
region?: IRegion;
district?: string;
password: string;
}

export interface IGuide {
Expand Down

0 comments on commit e1bed6c

Please sign in to comment.