fix authentication
This commit is contained in:
@@ -28,11 +28,18 @@ export const authService = {
|
||||
* Handle OAuth callback - send code to backend, receive JWT
|
||||
*/
|
||||
async handleCallback(code: string): Promise<AuthCallbackResponse> {
|
||||
const response = await api.post<AuthCallbackResponse>('/api/auth/callback', {
|
||||
const response = await api.post<{
|
||||
success: boolean;
|
||||
message: string;
|
||||
data: { accessToken: string; refreshToken: string; user: User };
|
||||
}>('/api/auth/callback', {
|
||||
code,
|
||||
redirect_uri: REDIRECT_URI,
|
||||
});
|
||||
return response.data;
|
||||
return {
|
||||
token: response.data.data.accessToken,
|
||||
user: response.data.data.user,
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user