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

Issue 15 add local login page url #17

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

annemarie35
Copy link
Collaborator

No description provided.

@cypress
Copy link

cypress bot commented Aug 4, 2020



Test summary

0 6 0 0


Run details

Project Moss
Status Failed
Commit 1a0e4cd
Started Nov 15, 2020 10:37 AM
Ended Nov 15, 2020 10:38 AM
Duration 01:43 💡
OS Linux Ubuntu Linux - 16.04
Browser Electron 78

View run in Cypress Dashboard ➡️


Failures

create_question_page/create_question_page.spec.js Failed
1 Create question page > Renders a form to create the question
home_page/home_page.spec.js Failed
1 Home page > Displays a link to each question page
2 Home page > Displays a link to the create question form
question_page/question_page.spec.js Failed
1 Question page > Renders the question
2 When the user has already voted > Renders the results
3 When the user can vote > Renders the options

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Aug 4, 2020



Test summary

0 6 0 0


Run details

Project Moss
Status Failed
Commit 481d8fc ℹ️
Started Nov 15, 2020 10:37 AM
Ended Nov 15, 2020 10:38 AM
Duration 01:35 💡
OS Linux Ubuntu Linux - 16.04
Browser Electron 78

View run in Cypress Dashboard ➡️


Failures

create_question_page/create_question_page.spec.js Failed
1 Create question page > Renders a form to create the question
home_page/home_page.spec.js Failed
1 Home page > Displays a link to each question page
2 Home page > Displays a link to the create question form
question_page/question_page.spec.js Failed
1 Question page > Renders the question
2 When the user has already voted > Renders the results
3 When the user can vote > Renders the options

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

.env Outdated Show resolved Hide resolved
src/utils/token.ts Outdated Show resolved Hide resolved
src/utils/token.ts Outdated Show resolved Hide resolved
.env.sample Outdated
@@ -1 +1,2 @@
REACT_APP_API_URL='http://localhost:3000/api/v1/'
REACT_APP_API_URL=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le API contient le /api/v1 et le base non ? Si oui, on peut mettre ça quelque part ? (Genre readme ou dans le .sample)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui en effet, y'a de la duplication.
J'aime bien aussi :

REACT_APP_API_PATH='/api/v1'
REACT_APP_BACK_BASE_URL='http://localhost:3000'

Il y aurait juste const apiUrl = process.env.REACT_APP_API_URL!; dans index.tsx à modifier

Pour cette ligne dans package.json par contre, j'ai l'impression qu'il y une coquille dans celui actuel :

"test:serve": "REACT_APP_API_URL=/api/v1 BROWSER=none yarn start",

C'est pas documenté dans le readme, pourquoi est-ce qu'on a cette commande yarn test:serve tu sais

Copy link

@gael-boyenval gael-boyenval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chez moi, deploy/netlify plante.
J'arrive sur une page qui semble requetter en boucle.

@annemarie35 annemarie35 force-pushed the issue-15-add-local-login-page-url branch from 5d6461b to db30b70 Compare August 25, 2020 12:38
@annemarie35
Copy link
Collaborator Author

chez moi, deploy/netlify plante.
J'arrive sur une page qui semble requetter en boucle.

Salut @gael-boyenval
J'arrive pas trop à visualiser quel est ton problème.
Est-ce que tu as pu lancer l'app en local avec le back qui tourne ? J'ai eu ce problème de page qui tourne en boucle, cela venant des variables d'environnement qui n'était pas à jour.

.env.sample Outdated
@@ -1 +1,2 @@
REACT_APP_API_URL='http://localhost:3000/api/v1/'
REACT_APP_API_PATH=
REACT_APP_BACK_BASE_URL=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je dirais qu'on peut remplacer BACK par API, pour indiquer que c'est la même application. Ça permet de moins se poser de questions.

@@ -14,7 +14,10 @@ import * as serviceWorker from "./serviceWorker";
import { Theme } from "./ui/Theme/Theme";

const authToken = getOauthTokenOrRedirect();
const apiUrl = process.env.REACT_APP_API_URL!;

const apiPath = process.env.REACT_APP_API_PATH!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas sûr que ce soit nécessaire de variabiliser le path de l'API. Ce n'est pas comme si on avait plusieurs versions de l'API pour l'instant.

Suggested change
const apiPath = process.env.REACT_APP_API_PATH!;
const apiPath = "/api/v1";

@ArnoHolo
Copy link
Contributor

Hello !

J'ai fait une modif côté back pour que l'API soit sur le port 3001 en local afin qu'il n'y ait pas de redirections en boucle.

J'ai réussi à faire fonctionner cette branche (pas de redirections) côté front en renseignant cela dans .env :

REACT_APP_BACK_BASE_URL=http://localhost:3001
REACT_APP_API_PATH=/api/v1

@ArnoHolo ArnoHolo force-pushed the issue-15-add-local-login-page-url branch from e27e881 to 21a8495 Compare November 15, 2020 10:33
@ArnoHolo ArnoHolo force-pushed the issue-15-add-local-login-page-url branch from 21a8495 to 1a0e4cd Compare November 15, 2020 10:34
@ArnoHolo ArnoHolo linked an issue Nov 15, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[contributing] Utiliser Google Auth en local
4 participants