🐛 Fix Google authentication
Tim Izzo tim@octree.ch
Tue, 30 Aug 2022 13:51:07 +0200
2 files changed,
13 insertions(+),
1 deletions(-)
M
frontend/hooks/useLoginWithProvider.ts
→
frontend/hooks/useLoginWithProvider.ts
@@ -5,7 +5,7 @@ const setToken = useAuthStore(s => s.setToken);
const setUser = useAuthStore(s => s.setUser); const loginWithProvider = async (provider: string, search: string) => { - const resultRaw = await fetch(`/auth/${provider}/callback${search}`); + const resultRaw = await fetch(`/api/auth/${provider}/callback${search}`); const result = await resultRaw.json(); if (result.hasOwnProperty('error')) throw result; setToken(result.jwt);
M
frontend/next.config.js
→
frontend/next.config.js
@@ -12,6 +12,18 @@ {
source: '/api/:slug*', destination: `${STRAPI_URL}/api/:slug*`, }, + { + source: '/admin/:slug*', + destination: `${STRAPI_URL}/admin/:slug*`, + }, + { + source: '/i18n/:slug*', + destination: `${STRAPI_URL}/i18n/:slug*`, + }, + { + source: '/content-manager/:slug*', + destination: `${STRAPI_URL}/content-manager/:slug*`, + }, ]; },