Aksha Malik
03/23/2026, 4:41 PMonLoginFormSubmit(event: Event): void {
event.preventDefault();
if (this.flowConfigInvalid()) {
return;
}
if (!this.nextFn) {
this.snackbarService.showError('Authentication flow not initialized.');
return;
}
if (this.loginForm.invalid) {
this.loginForm.markAllAsTouched();
return;
}
this.loginCompleted.set(false);
this.isLoading.set(true);
this.exchangeInProgress.set(true);
this.loaderService.show();
const { email, password } = this.loginForm.getRawValue();
this.loginByosFlowOrchestrator
.submitCredentialsAndExchange$({
nextFn: this.nextFn,
interactionId: this.loginFlowInteractionId,
email,
password,
})
.pipe(
tap(() => {
this.loginCompleted.set(true);
void this.router.navigate([ROUTES.DASHBOARD]);
}),
catchError((err: unknown) => {
this.snackbarService.showError(this.resolveLoginErrorMessage(err));
return EMPTY;
}),
finalize(() => {
this.isLoading.set(false);
this.exchangeInProgress.set(false);
this.loaderService.hide();
}),
takeUntilDestroyed(this.destroyRef),
)
.subscribe();
}
this is showing error as Did not find next task Could not get next task for [Login] Error for this api when called
Request URL
<https://api.descope.com/v1/flow/next>
Request Method
POST
Status Code
400 Bad Request
Remote Address
104.18.27.223:443
Referrer Policy
strict-origin-when-cross-origin
payload is sent as
{
"executionId": "direct-signup-signin-flow-dev|#|3BM0cr4NfHNmB2Yo9RebQs4KYe1",
"stepId": "1",
"interactionId": "AMeyg_7npFqa",
"version": 1,
"componentsVersion": "3.0.2",
"input": {
"email": "<mailto:aksha+8030@signitysolutions.com|aksha+8030@signitysolutions.com>",
"password": "Test@123"
}
}
response
{
"errorCode": "E102103",
"errorDescription": "Did not find next task",
"errorMessage": "Could not get next task for [Login]",
"message": "Could not get next task for [Login]"
}
can you please help understand what could be the issue here in the function writtenDevRev
03/23/2026, 4:41 PMstepId or flow structure.
Check Flow Configuration
1. Verify your flow has a Login screen with the correct step ID
2. In the Descope console, check your flow's Login screen step ID - it might not be "1"
3. Ensure the Login screen has the expected interaction ID "AMeyg_7npFqa"
// Debug by logging the flow response before calling next
console.log('Flow execution details:', {
executionId: this.loginFlowInteractionId,
stepId: '1', // Verify this matches your flow
interactionId: this.nextFn?.interactionId
});
Verify BYOS Setup
The error suggests a mismatch between your flow configuration and the API call. Check that:
• Your flow's Login screen step ID matches the stepId in the payload
• The interaction ID from onScreenUpdate callback matches what you're sending
• The screen expects email and password inputs as configured
Bring Your Own Screen | Descope DocumentationAksha Malik
03/23/2026, 4:53 PMDevRev
03/23/2026, 4:54 PM// Add this before your API call to debug the flow state
console.log('Current flow state:', {
executionId: this.loginFlowInteractionId,
nextFn: this.nextFn,
interactionId: this.nextFn?.interactionId
});
Common Fixes
• Connect your Login screen's success button to the next flow step
• Add an End action if the flow terminates after login
• Check that conditional logic doesn't create dead ends in your flow
The issue is likely in your flow builder configuration, not your Angular code.
Descope Common Errors | Descope DocumentationAksha Malik
03/23/2026, 4:54 PMDevRev
03/23/2026, 4:54 PMstepId: "1"
2. Check the interactions - verify the success interaction ID matches what you're sending
3. Trace the connections - ensure the Login screen connects to another step
Key Things to Look For
// In your flow export, find:
{
"screens": [
{
"stepId": "1", // This should match your API call
"interactions": [
{
"id": "AMeyg_7npFqa", // Should match your interactionId
"nextStepId": "2" // Must point to valid next step
}
]
}
]
}
Common Issues
• Login screen's success interaction doesn't have a nextStepId
• The nextStepId points to a non-existent step
• Missing End action if the flow should terminate after login
Can you check if your Login screen (stepId "1") has a valid connection to the next step in the exported JSON? The issue is likely that the success interaction isn't properly connected to another flow step .
Descope Common Errors | Descope DocumentationAksha Malik
03/23/2026, 4:55 PMDevRev
03/23/2026, 4:55 PMAksha Malik
03/23/2026, 4:57 PMsubmitCredentialsAndExchange$(input: SubmitCredentialsAndExchangeInput): Observable<void> {
const { nextFn, interactionId, email, password } = input;
return from(nextFn(interactionId, { email, password })).pipe(
switchMap(result => {
if (result == null) {
return EMPTY;
}
if (!isDescopeNextResultCandidate(result)) {
return throwError(
() =>
new LoginFlowError('UNKNOWN', 'Unexpected response from sign-in.'),
);
}
const descopeResult = result;
if (isPasswordSignInFailed(descopeResult)) {
return throwError(
() =>
new LoginFlowError(
'WRONG_PASSWORD',
getPasswordSignInFailedMessage(descopeResult),
),
);
}
const code = sessionStorage.getItem(DIRECT_LOGIN_SESSION_KEYS.CODE)?.trim();
const codeVerifier = sessionStorage.getItem(AUTH_FLOW_SESSION_KEYS.PKCE_CODE_VERIFIER)?.trim();
const state = sessionStorage.getItem(DIRECT_LOGIN_SESSION_KEYS.STATE);
const pkceState = sessionStorage.getItem(AUTH_FLOW_SESSION_KEYS.PKCE_STATE);
if (!codeVerifier) {
return throwError(
() =>
new LoginFlowError(
'SESSION_EXPIRED',
'Session expired. Please sign in again.',
),
);
}
// OIDC redirect_uri is /login-exchange-token: auth code arrives there, not on /login.
// Same-page exchange runs only when code was already stored (e.g. ?code= on /login).
if (!code) {
return EMPTY;
}
if (state && pkceState && state !== pkceState) {
return throwError(
() =>
new LoginFlowError(
'SESSION_EXPIRED',
'Session expired. Please sign in again.',
),
);
}
return this.loginByosExchange.exchangeDirectByosSessionToTokens$().pipe(
catchError((err: unknown) => this.normalizeExchangeError(err)),
);
}),
);
}DevRev
03/23/2026, 4:57 PMnextFn call.
The Issue
Your code expects to find a code in sessionStorage after the flow completes, but with BYOS login flows, the code isn't automatically stored there. When code is null, your service returns EMPTY, which means the observable completes without emitting any value.
The Fix
The nextFn call should complete the flow and provide the tokens directly. You shouldn't need to do a separate token exchange for a basic login flow. Try this simplified version:
submitCredentialsAndExchange$(input: SubmitCredentialsAndExchangeInput): Observable<void> {
const { nextFn, interactionId, email, password } = input;
return from(nextFn(interactionId, { email, password })).pipe(
switchMap(result => {
if (result == null) {
return EMPTY;
}
if (!isDescopeNextResultCandidate(result)) {
return throwError(
() => new LoginFlowError('UNKNOWN', 'Unexpected response from sign-in.')
);
}
if (isPasswordSignInFailed(result)) {
return throwError(
() => new LoginFlowError(
'WRONG_PASSWORD',
getPasswordSignInFailedMessage(result)
)
);
}
// For basic login flows, the tokens should be available directly
// Check if result contains tokens or if flow completed successfully
return of(undefined); // Success case
}),
catchError((err: unknown) => this.normalizeExchangeError(err))
);
}
Root Cause
Your flow is completing successfully, but your service logic is looking for an authorization code that doesn't exist in a direct login scenario. The E102103 error might be a red herring - the real issue is your token exchange logic expecting OIDC flow artifacts that aren't present in BYOS flows.