Skip to content

Commit

Permalink
Saving token in the localStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
ChampionBuffalo1 committed Oct 3, 2023
1 parent 972333f commit 29ea847
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/AuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function AuthForm({ type }: AuthenticationProps) {
return data;
},
onSuccess: data => {
const { token } = data.results[0];
const { token } = data;
localStorage.setItem('token', token);
}
});
Expand Down Expand Up @@ -98,5 +98,5 @@ type MutationFnParam = {
};

interface ReturnObj {
results: { success: boolean; token: string }[];
token: string;
}

0 comments on commit 29ea847

Please sign in to comment.