You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your app always redirects to the **HomePage** in **Run Mode**, even after a previous login, it's likely caused by **retained authentication state** or **cached session data** in your browser.
9
+
10
+
## Troubleshooting Steps
11
+
12
+
- Clear your browser cache and history.
13
+
14
+

15
+
16
+
- Try a different browser or use incognito/private browsing mode to see if the issue persists.
17
+
18
+
If the problem continues, consider checking your authentication flow and session management in your app settings.
19
+
20
+
:::tip[Reset Authentication State in Run Mode]
21
+
When using **Run Mode**, FlutterFlow preserves your **authentication state** across sessions. To test your app from a clean state, add a **"Log Out"** button on your HomePage that triggers the `Sign Out` action. This ensures the app starts from the login screen during your next test.
title: How to Retrieve the Authenticated Type from Firebase Auth
3
+
slug: /check-firebase-login-method
4
+
title: Check Firebase Login Method
5
5
---
6
-
# Retrieve the authenticated type from Firebase auth
6
+
# Check Firebase Login Method
7
7
8
8
Understanding which authentication method a user has used can be useful for several reasons. For example, it can be leveraged for analytics, user support, and to customize the user's experience based on their login method. This method, however, is specific to Firebase Authentication.
9
9
10
10
In our Flutter app, we can find out which method a user used to authenticate by leveraging Firebase's `User.providerData` property. Let's take a closer look at how this works in the code:
@@ -51,7 +52,8 @@ Here are examples of how the return value might look:
51
52
52
53
- If the user has signed in using Email and Password, the function will return: **`'password'`**
53
54
54
-
These are the identifiers used by Firebase to represent different sign-in methods.Please, thoroughly test this function to ensure it fits your specific requirements.
55
+
These are the identifiers used by Firebase to represent different sign-in methods.
56
+
Please thoroughly test this function to ensure it fits your specific requirements
55
57
56
58
:::tip[Use Sign-In Method to Drive Dynamic UI in FlutterFlow]
57
59
In FlutterFlow, if you want to display or use the user's sign-in method in your UI logic (example, showing different UIs for Google vs. email login), you can create a custom function using the `providerId` approach shown in the article and **connect it to a custom action**. This allows you to make dynamic decisions inside your app based on how the user authenticated.
Copy file name to clipboardExpand all lines: docs/troubleshooting/authentication/custom_authentication_in_flutterFlow.md
+28-35Lines changed: 28 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,62 +6,55 @@ title: Custom Authentication in FlutterFlow
6
6
# Custom Authentication in FlutterFlow
7
7
8
8
:::info[Prerequisites]
9
-
Ensure you have a **custom server** with login and sign-up endpoints that return a JWT token upon success
9
+
Ensure you have a **custom server** with login and sign-up endpoints that return a JWT token upon success.
10
10
11
-
**Custom authentication** must be enabled in FlutterFlow, with entry and logged-in pages correctly set
11
+
**Custom authentication** must be enabled in FlutterFlow, with entry and logged-in pages correctly set.
12
12
:::
13
13
14
-
15
-
Here's an example:
14
+
Here's an example:
16
15
17
16

18
17
19
-
## Checklist for Troubleshooting
18
+
## How to Fix Custom Authentication Issues in FlutterFlow
20
19
21
20
### 1. Verify Server and API Endpoints
22
-
- Confirm that your server is correctly returning JWT tokens for login and sign-up requests. The server's response should include the authentication token, refresh token, expiration time, and user ID (UID).
23
-
- Double-check the API endpoint configurations in FlutterFlow to match your server's requirements.
21
+
- Confirm that your server correctly returns JWT tokens for login and sign-up requests. The server's response should include the **authentication token**, **refresh token**, **expiration time**, and **user ID (UID)**.
22
+
- Double-check the API endpoint configurations in FlutterFlow to ensure they match your server’s requirements.
24
23
25
24
### 2. FlutterFlow Configuration
26
-
- Make sure custom authentication is enabled in the project settings.
27
-
- Verify that the entry point and logged-in pages are set correctly.
25
+
- Make sure **Custom Authentication** is enabled in your project settings.
26
+
- Verify that the **Entry Page** and **Logged In Page**are correctly set.
28
27
29
28
### 3. UI Configuration
30
-
- To facilitate the authentication flow, ensure your app has at least three pages:
31
-
32
-
**Login**
33
-
34
-
**Sign Up**
35
-
36
-
**Home Page** (i.e. the landing page when a user successfully authenticates)
29
+
- Ensure your app includes the essential pages for the authentication flow: **Login**, **Sign Up**, and **Home Page** (the page shown when a user is authenticated).
37
30
38
31
### 4. API Integration and Authentication Flow
39
-
- Test API calls from FlutterFlow to your server and ensure responses are received as expected.
40
-
- Upon successful authentication, use the backend FlutterFlow action to call the API. Then, utilize the response data to perform a "custom login" action within FlutterFlow.
32
+
- Test API calls from FlutterFlow to your custom server to confirm responses are working as expected.
33
+
- Use the **Backend Call** action to trigger login/signup, then handle the **Custom Login** action using the response data.
41
34
42
35
### 5. Handling Tokens and User Data
43
-
- Set up your FlutterFlow actions to correctly parse the API response, capturing the auth token, refresh token, expiration time, and user ID (UID). This data is crucial for managing user sessions.
36
+
- Parse the API response properly to extract and store:
37
+
-`auth token`
38
+
-`refresh token`
39
+
-`expiration time`
40
+
-`user ID (UID)`
41
+
- Store these values in local state or secure app storage.
44
42
45
43

46
44
47
45
### 6. Navigation
48
-
- If automatic navigation after login or sign-up is not working, you can disable it.
49
-
- Then, opt for manual navigation to ensure users are directed to the correct page after authentication.
46
+
- If navigation does not occur automatically after login/signup:
47
+
- Disable automatic navigation.
48
+
- Use a **manual navigation** action to route users to the appropriate page.
50
49
51
50
:::tip[General Tips]
52
-
- Before integrating real user data, test your custom authentication flow using **dummy credentials** on your server. This allows you to debug token handling, API responses, and navigation logic safely—without risking user experience or exposing sensitive data.
53
-
54
-
- Utilize logging both on your server and within FlutterFlow (snack bars, alerts) actions to track the authentication flow and identify any points of failure.
55
-
56
-
- Test the entire authentication flow, from entering credentials to accessing protected pages after login, to ensure there are no breaks in the process.
51
+
- Test your flow with **dummy credentials** before using real user data. This helps debug token handling, API responses, and navigation.
52
+
- Add **logging** on both the server and in FlutterFlow (e.g., using snack bars or alerts) to monitor each step of the flow.
53
+
- Verify the full flow—from login to protected pages—to ensure everything works as expected.
title: Deleting Firebase Users and Related Data in FlutterFlow
5
+
---
6
+
# Deleting Firebase Users and Related Data in FlutterFlow
7
+
8
+

9
+
10
+
## Understanding the Delete Action
11
+
12
+
The delete action in Firebase is designed to remove the user from the authentication table only. This means the user's document in the database will not be affected. If you want to delete the user's document from the database as well, you'll need to create a custom action with some custom code.
13
+
14
+
## Logging Out After Deletion
15
+
16
+
After completing the delete action, it is important to log out the user. Since the user no longer exists in the authentication system, logging out ensures the app routes the user back to the login page, which is typically the initial page of your project.
17
+
18
+
## Steps for Proper User Deletion
19
+
20
+
1.**Delete related data first:**
21
+
Before calling the delete user action, delete any related data such as Firestore documents or Storage files associated with the user. Once the user is deleted from Firebase Auth, their UID will no longer be accessible in the app session, making it difficult to reference their data afterward.
22
+
23
+
2.**Handle re-login behavior:**
24
+
Keep in mind that if the same user signs in again using the same signup method, Firebase will create a new document in the database for them. This happens because Firebase links the new login information to the old user document.
25
+
26
+
:::tip[Important Tips for Deleting Users]
27
+
- Always delete associated user data from Firestore or Storage **before** deleting the user from Firebase Auth. This prevents orphaned data and issues with data referencing.
28
+
- Remember that after deletion, the user will need to be logged out to avoid session errors.
29
+
- If the user signs in again with the same signup method, Firebase creates a new document for them, reconnecting the new login to the old user document.
30
+
:::
31
+
32
+

33
+
34
+
:::note
35
+
The delete user action in FlutterFlow performs the same operation as manually deleting a user from the Firebase Authentication table.
Copy file name to clipboardExpand all lines: docs/troubleshooting/authentication/my_app_is_starting_from_homepage_after_logging_in_once_in_the_run_mode.md
0 commit comments