Skip to content
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

try and fix this weird login bug: #59

Closed
wants to merge 18 commits into from
5 changes: 4 additions & 1 deletion client/src/lib/api/UserAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import axios from 'axios';

export const login = async (email: string, password: string): Promise<string> => {
const requestBody: LoginRequest = { email, password };
const response = await axios.post<LoginResponse>('/api/login', requestBody);
const response = await axios.post<LoginResponse>('/api/login', requestBody, {
headers: { 'Cache-Control': 'no-cache' },
});
return response.data.token;
};

Expand All @@ -23,6 +25,7 @@ export const getCurrentUser = async (token: string): Promise<PrivateProfile> =>
{
headers: {
Authorization: `Bearer ${token}`,
'Cache-Control': 'no-cache',
},
}
);
Expand Down
Loading