Skip to content

LogOut Redirection code gets generated out of the Condition when the action is performed inside a condition branch #1599

@mehdidou99

Description

@mehdidou99

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.
  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

I perform a LogOut action inside of a conditional action branch ; the "logout" part is generated at the correct place, but the last instruction (a redirection to the logged out page) is generated outside the condition branch and thus always happen, even when the condition is not met.

Expected Behavior

The redirection only happens when the condition is met.

Steps to Reproduce

  1. Create a project with authentication
  2. Create a LoggedIn page
  3. Create an "On Load" action with a condition
  4. Add a "LogOut" action to one of the branches
  5. View code

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

ITEels/l25RJpb0B17XicPowiQMwJ0QlUIInj+0bWRMhfarmELMiZffeXElLYteifVZAAFql8VEdw8nGjoaSOsACJk2aGoRDzoRXQTrKTn25aZiSO86KeXdRI+ZMCh2Z37uFpBZvNuxhcUVn1GeAevCdG3qCf9qOYwx5e6fDbOY=

Context

I sometimes delete some accounts outside of the app. When that happens, the user is not automatically logged out, so there is a never ending loading when he goes to the Profile page (which is caused by a query to get the user document that never gets it because it is deleted)
So I added an On Load action to check if the document exists and logs out when it does not exist, avoiding this issue, but now the user is always redirected to my LoggedOut page every time he goes to the profile page.

Visual documentation

image
image

Additional Info

No response

Environment

- FlutterFlow version: v4.0
- Platform: Web
- Browser name and version: Chrome Version 116.0.5845.179
- Operating system and version affected: Ubuntu 22.04.3 LTS

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions