feat: refactoring auth & add email password login (#318)

* feat: wip

* fix: issues

* feat: clean controllers and services

* fix: test

* Fix auth

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Jérémy M
2023-06-17 13:42:02 +02:00
committed by GitHub
parent d13ceb98fa
commit 299ca293a8
215 changed files with 1668 additions and 680 deletions

View File

@ -10,7 +10,7 @@ import { onError } from '@apollo/client/link/error';
import { RestLink } from 'apollo-link-rest';
import { CommentThreadTarget } from './generated/graphql';
import { refreshAccessToken } from './modules/auth/services/AuthService';
import { getTokensFromRefreshToken } from './modules/auth/services/AuthService';
const apiLink = createHttpLink({
uri: `${process.env.REACT_APP_API_URL}`,
@ -34,7 +34,7 @@ const errorLink = onError(({ graphQLErrors, operation, forward }) => {
return new Observable((observer) => {
(async () => {
try {
await refreshAccessToken();
await getTokensFromRefreshToken();
const oldHeaders = operation.getContext().headers;