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

tech(redirect): ETQ usager non connecté, je suis automatiquement redirigé de demarches-simplifiees vers le nouvel host #10042

Merged

Conversation

mfo
Copy link
Contributor

@mfo mfo commented Feb 26, 2024

No description provided.

@mfo mfo force-pushed the US/vers-demarches-gouv-et-lau-dela branch from e84748e to 920ae98 Compare February 27, 2024 15:30
def auto_switch_domain?(request, user_signed_in)
maybe_switch_domain_enabled = request.params.key?(:switch_domain) || Flipper.enabled?(:switch_domain)

maybe_switch_domain_enabled && !user_signed_in && app_host_legacy?(request)
Copy link
Member

Choose a reason for hiding this comment

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

pas user_signed_in? ? (avec le ?)
et je me rappelle plus pourquoi on veut le fairei que n'étant pas connecté, on en a du en parler mais j'ai zappé. En tout cas ok peut se limiter à ça au début

Copy link
Member

@colinux colinux Feb 27, 2024

Choose a reason for hiding this comment

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

si tu peux rajouter un helper

def switch_domain_enabled? 
  request.params.key?(:switch_domain) || Flipper.enabled?(:switch_domain)
end

comme ça je reprend la même pour l'affichage de la bannière

Copy link
Contributor Author

Choose a reason for hiding this comment

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

user_signed_in?, c'est un helper devise, pas dispo ds les specs des helpers. bref, d'ordre general, je prefere ne pas me reposer sur trop de dependance ds la methode, mais les donner

Copy link
Contributor Author

@mfo mfo Feb 27, 2024

Choose a reason for hiding this comment

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

pour la question du prk en user_signed_in?, je crois qu'on voulait faire de l'opt-in, sinon on aurait redirigé automatiquement via le token. en tous cas, c'est ds le plan

Copy link
Member

Choose a reason for hiding this comment

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

je crois qu'on parlait de l'optin si on ne faisait pas de détection auto. De toute façon je suis plutôt de voir ce que donne en vrai la détection, et si c'est OK assez rapidement migrer tout le monde quand elle est OK

fetch(hintUrl)
.then(function(){
window.location = window.location.href.replace("#{ApplicationHelper::APP_HOST_LEGACY}", "#{ApplicationHelper::APP_HOST}")
})
Copy link
Member

Choose a reason for hiding this comment

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

il se passe quoi quand ça fail ?
A terme on pourrait imaginer ping sentry en catchant et re-throwant une erreur bien spécifique

Copy link
Contributor Author

@mfo mfo Feb 27, 2024

Choose a reason for hiding this comment

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

pr le moment rien, car on souhaite ne pas rediriger :D mais oui ça fait partie du plan https://pad.numerique.gouv.fr/T4UcePBKR6KGzbjsWQJylw#

@mfo mfo force-pushed the US/vers-demarches-gouv-et-lau-dela branch from 920ae98 to a135947 Compare February 28, 2024 05:24
@mfo mfo enabled auto-merge February 28, 2024 08:46
@mfo mfo added this pull request to the merge queue Feb 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 28, 2024
@mfo mfo added this pull request to the merge queue Feb 28, 2024
Merged via the queue into demarches-simplifiees:main with commit c0d1205 Feb 28, 2024
15 checks passed
@mfo mfo deleted the US/vers-demarches-gouv-et-lau-dela branch February 28, 2024 10:40
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.

2 participants