Commit 5814f235 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: Google login requires its clientId

parent d6d7598a
...@@ -62,8 +62,9 @@ export class LoginService { ...@@ -62,8 +62,9 @@ export class LoginService {
}); });
} }
public static verifyGoogleToken(tokenId) { public static verifyGoogleToken(googleClientId: string, tokenId) {
const form = new FormData(); const form = new FormData();
form.append('clientId', googleClientId);
form.append('tokenId', tokenId); form.append('tokenId', tokenId);
return axiosBackend.post(VERIFY_GOOGLE_TOKEN_URL, form) return axiosBackend.post(VERIFY_GOOGLE_TOKEN_URL, form)
......
...@@ -62,8 +62,8 @@ export const verifyGoogleToken = (payload) => { ...@@ -62,8 +62,8 @@ export const verifyGoogleToken = (payload) => {
}; };
export const verifyGoogleTokenRequest = (tokenId) => (dispatch, getState) => { export const verifyGoogleTokenRequest = (tokenId) => (dispatch, getState) => {
const googleClientId = getState().applicationConfig.googleClientId;
return LoginService.verifyGoogleToken(tokenId) return LoginService.verifyGoogleToken(googleClientId, tokenId)
.then((data) => { .then((data) => {
saveCookies(data, data.exp * 1000 || new Date().getTime() + data.expires_in * 1000); saveCookies(data, data.exp * 1000 || new Date().getTime() + data.expires_in * 1000);
return dispatch(loginApp(data)); return dispatch(loginApp(data));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment