# User Authentication Status

div
div
Client SDK
div
Backend API
div
Mobile approve
div
SSO
div
Sub-journey
> Checks if the user has already authenticated in this journey


## Description

This step checks if the user has successfully completed an authentication step in this journey, which authenticates the user using a login method (e.g., password or email OTP). If the user is authenticated, the journey proceeds to the `Yes` branch. If not, the journey proceeds to the `No` branch.

This step is equivalent to the `@policy.isUserAuthenticated()` expression. The expression form can be used in the configuration of other journey steps or external connections.

## Example

Here are a few examples of how this step can be used:

- [Example 1: Subjourneys](#example-1-subjourneys)
- [Example 2: After while loop](#example-2-after-while-loop)


### Example 1: Subjourneys

Journey logic may become complex and subjourneys allow breaking it down into modular components. If a subjourney is intended for authenticated users only, you can add this step as the first step in the subjourney to ensure it's only executed for authenticated users. This enhances the security of your flows since subjourneys could be invoked from any journey.

### Example 2: After while loop

Consider a [While Loop](/guides/orchestration/journeys/while_loop) step that's used to limit the number of unsuccessful authentication attempts before offering a different method (as described in [this example](/guides/orchestration/journeys/while_loop#example-2-while-iterations-is-less-than-x)). In the example, the loop stops when either the user successfully authenticates or exceeds 3 retries. The logic that follows the loop should be based on whether or not the user authenticated. This can be done by adding the **User Authentication Status** step after the loop. The **Yes** branch can be used to complete the journey, while the **No** branch can be used to offer the user a different method.

![](/assets/is_user_authenticated_ex2.2880206fa8a89b7fb0a2847f3528f3105116ac4c95849fe6180927af00b215a2.6f9096f8.png)