Hi all, I'm having some urgent issues and I'm not...
# ask-a-descoper
m
Hi all, I'm having some urgent issues and I'm not exactly sure what's left for me to do. I've just configured a custom domain, and when going to it I am getting a 404 nginx error and no users are able to log in. I've confirmed the DNS records are setup correctly, and I've checked all the configuration, and have even tried a different domain but am still getting the same error. Is there anyway to triple check / confirm / are there any known resolutions to this?
a
Hi @Matthew Thomas A 404 nginx page on a custom domain usually means the request is reaching our edge, but the domain hasn’t been fully mapped/activated on Descope yet. A couple of quick things we can double-check: • In the Descope console under Custom Domains, does the domain show Verified + Active? • DNS record should be a CNAME →
<http://cname.descope.com|cname.descope.com>
• If you just set it up, it can take a bit for DNS + provisioning to fully propagate • If everything looks right, try removing and re-adding the domain once to retrigger provisioning.
m
Thanks for the response - i've done all of the above and its been 12 hours atleast, is this long enough?
I'm getting all kinds of random errors everywhere as well, and some places are trying to lookup an old URL I had there 24 hours ago but changed trying to fix these issues
The base auth.descope.io endpoints still appear to work, but if I turn on cookies, they return and then try lookup against the old URL - is this all a timing thing or? Just kinda lacking a lot of information as to whats going on
a
Have you tried on Incognito / Private window ? The browser might use old cookies from the previous domain.
m
Yes, have tried multiple devices
the other errors I'm getting are • When I switch the passkey domain to the new domain, users when going to add a passkey just watch the descope flow hang - so they tap add passkey and it just spins forever • On web, if cookies are not enabled, the flow cannot continue at all, however it correctly uses the base URL and is able to continue the flow without the 404 issue, despite it not working on the flutter mobile ios popup
a
Okay! Can you please the screenshot what issue you are seeing on UI?
Can you please tell me which domain you have configured ?
m
The UI issue is just that the spinner on the next button spins forever
I had configured auth.fieldcare.ai, however, in trying to troubleshoot this I'm switching back to auth.app.fieldcare.ai
a
Okay!
m
So just after plugging around, some more information • Using the flutter descope package, deploying both to web and to IOS • I have now set the app domain to app.fieldcare.ai, which is where the web version is hosted. I have also set the custom domain to auth.app.fieldcare.ai • I set the passkey domain to be app.fieldcare.ai • I turn on cookies for both session and jwt tokens rather than in the response return • On IOS, when i set the baseURL in the descope client initialisation as auth.app.fieldcare.ai, and I send the user to the flows defined with auth.app.fieldcare.ai, the webpopup that is triggers appears with a 404 nginx screen and the user does not see the flow. If i change the URL and send them to the auth.descope.io path, it appears, but the user is unable to continue to a passkey auth and it just spins on the next button, and then resets back to the begining. • On Web, with the same codebase etc, hosted at app.fieldcare.ai, I am able to authenticate all the way through, however despite a 200 at the last step I do not appear to be given a valid credential and the button that initiates the flow just spins
should i be setting different sub domains for different areas or something?
a
@Aditya Arakal @Bhagwanta Yeole Please assist here.
👀 1
m
am avaiable to share screen etc as needed
b
Hi @Matthew Thomas , Let me check this, will get back to you
m
thank you
For some extra debugging, for the web version, this call final authResponse = await Descope.flow.start(options); never appears to finish, it just runs forever
is there anything I can do here?
b
I'm checking for this with the internal team.
m
thank you
b
Can you please share the screenshot of the error?
m
which error
this is the 404 that appears in the popped up browser for IOS
For web, I do not get an error shown to me, I just never have anything returned
b
Can you please share the URL on which you are getting this?
m
auth.app.fieldcare.ai/<project-id>?flow=main
P38fz7CZ2Q9Ew6xgir6Upei5phQg
is the project id
this is the code that is called to login Future<void> *_handlePhoneLogin*() async { setState(() => _isLoading = true); try { final options = DescopeFlowOptions( _mobile_: DescopeMobileFlowOptions( _flowUrl_: _phoneFlowUrl, _deepLinkUrl_: '<your_deep_link_url>', ), _web_: DescopeWebFlowOptions( _flowId_: 'main', _flowContainerCss_: { 'background-color': '#FFFFFF', 'background': '#FFFFFF', 'width': '500px', 'min-height': '300px', 'margin': 'auto', 'position': 'relative', 'top': '50%', 'transform': 'translateY(-50%)', 'display': 'flex', 'flex-direction': 'column', 'align-items': 'center', 'justify-content': 'center', 'box-shadow': '0px 0px 10px gray', }, ), ); final authResponse = await Descope.flow.start(options); ScaffoldMessenger.of(context).showSnackBar( SnackBar( _content_: Text('auth response: ${authResponse.toString()}'), _backgroundColor_: Colors.blue, ), ); final session = DescopeSession.fromAuthenticationResponse(authResponse); print('Login response: ${session.toString()}'); ScaffoldMessenger.of(context).showSnackBar( SnackBar( _content_: Text('Login response: ${session.toString()}'), _backgroundColor_: Colors.blue, ), ); print('Login response phone: ${session.user.phone}'); Descope.sessionManager.manageSession(session); ScaffoldMessenger.of(context).showSnackBar( SnackBar( _content_: Text('Login response phone: ${session.user.phone}'), _backgroundColor_: Colors.orange, ), ); final phone = session.user.phone; if (phone == null || phone.isEmpty) { print('No phone found in Descope session'); throw Exception('No phone found in Descope session'); } print('Login response phone: ${session.sessionJwt}'); final sessionJwt = session.sessionJwt; const storage = FlutterSecureStorage(); await storage.write(_key_: 'auth_token', _value_: sessionJwt); final nameParts = session.user.name?.split(' ') ?? []; final user = await signupOrGetUser( _phone_: phone, _token_: sessionJwt, _firstName_: nameParts.isNotEmpty ? nameParts.first : null, _lastName_: nameParts.length > 1 ? nameParts.sublist(1).join(' ') : null, _email_: session.user.email, ); if (!mounted) return; if (_needsNameEntry(user)) { setState(() { _isLoading = false; _showNameEntry = true; _pendingPhone = phone; _pendingEmail = session.user.email; _firstNameController.text = user.firstName; _lastNameController.text = user.lastName; }); return; } await storage.write(_key_: 'user_data', _value_: json.encode(user.toJson())); await ensureLocationPermissionRequested(); if (!mounted) return; Navigator.of(context).pushNamedAndRemoveUntil('/home', (route) => false); } catch (e) { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( _content_: Text('Login failed: ${e.toString()}'), _backgroundColor_: Colors.red, ), ); } } finally { if (mounted && !_showNameEntry) { setState(() => _isLoading = false); } } }
none of the snack bars trigger
b
@Matthew Thomas
m
this works
👍 1
on browser just standing by for ios one second
this won't solve the other issue though
ok this resolved the IOS issue
however
Now on both IOS and web, after completing the flow, nothing happens
so same behaviour on both now
final authResponse = await Descope.flow.start(options); nothing seems to happen after this
is this something to do with cookies?
b
Are the cookies not being set on Web or iOS after completing the flow?
m
I am unclear, because it doesn't go past that line in the code
I am just doing some checks on web
b
Okay
m
ok confirmed on web, now after completing the flow, it hangs and never continues after that line of code
I can't get any debug details, it appears to be coming from inside the descope package
I do appear to have it working on IOS though
so it is just web that this is happening on
So just to summarise • The change to the login path resolved the 404 issue, thank you I'm not sure where this is documented to need this • Now, it appears that there is an issue with getting the flow to complete properly on Web, the same issue that was being reported before before we changed the flow URL • On IOS, everything appears to be building through correctly. It did fail to authenticate the first time like web, but after doing it a second time it was fine. I don't know if this is somehow related to the web issue
I don't have any logs other than that a minified exception is being thrown in web after completion of the flow - there are no network call errors though, and there is a 200 call that is showing a login success. The app is hosted at app.fieldcare.ai, the passkey domain is set to app.fieldcare.ai
b
Let me check for the web.
m
this is the cookie setting
specifically this is the console error
b
Do you have the user already created?
m
yes
same user on both ios and web
b
Can you please check in the users section of the descope console?
m
yes, they are there
b
Can you delete the user and try again?
m
have done that before and it didn't resolve, will try again
same issue, it goes through the full flow correctly, then errors at the end
this is the network tab
b
Can you please share the Step "#10.end" object?
From the console
m
Screenshot 2026-02-26 at 11.43.38.png
seems empty
it called create this time because i deleted the user
but it was get before i deleted the user
but the body looked the same other than the action being webauthnGet
I'm guessing that whatever error it is is because the ID is "", every other step has an ID that isn't empty, I don't know why these ID's would be empty
b
@Matthew Thomas Can you please share HAR file?
m
looking
uploading
app.fieldcare.ai.har
uploaded @Bhagwanta Yeole
sorry but to add more issues, while logging in is correct, after the package goes to refresh the token we get a series of errors Error getting auth token from Descope: ClientException with SocketException: Failed host lookup: 'auth.app.fieldcare.ai' (OS Error: nodename nor servname provided, or not known, errno = 8), uri=https://auth.app.fieldcare.ai/v1/auth/refresh
this may be a cname propegation thing
first priority is sorting the web login
b
Can you please check? When you initialize Descope with a custom domain using the
baseUrl
parameter, ensure the domain is correctly configured
Copy code
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
 
  Descope.setup('__ProjectID__', baseUrl: "<https://auth.app.fieldcare.ai>");
 
  await Descope.sessionManager.loadSession();
 
  runApp(const MyApp());
}
m
it is set correctly yes
Copy code
runZonedGuarded(
    () async {
      WidgetsFlutterBinding.ensureInitialized();
      try {
        Descope.setup('P38fz7CZ2Q9Ew6xgir6Upei5phQg', (config) {
          config.baseUrl = '<https://auth.app.fieldcare.ai>';
        });
        try {
          await Descope.sessionManager.loadSession();
        } catch (e, st) {
          // Session load can fail (e.g. network, storage) - continue to login
          debugPrint('Descope loadSession failed: $e\n$st');
        }
        await initializeServices();
      } catch (e, st) {
        debugPrint('Startup failed: $e\n$st');
        rethrow;
      }
      runApp(const MyApp());
    },
    (error, stack) {
      debugPrint('Unhandled error: $error\n$stack');
    },
  );
is there something missing?
b
Which SDK version are you using?
m
descope: ^0.9.12
b
Is this for flutter?
m
yes
i just tried upgrading to 0.9.13 and still same issue
Screenshot 2026-02-26 at 13.03.16.png
b
Please try to upgrade the web components
Copy code
npm install @descope/web-component
If you are using
m
i am not using
there is no npm, its just flutter
b
Oh! okay
m
for further debugging, i modified the flow and added a new screen at the end. It still threw the same error
so its not to do with the id being empty
something is just happening when it gets to the end state
Anything else I can do?
I did further debugging, and I was able to extract the error A.throwExpression(A.InternalErrors_add(B.DescopeException_Nsw, _null, _null, "Missing session JWT"));
your package is throwing missing session jwt
As a result, I turned off cookies for session token management, and the error was resolved
It appears your package needs to be updated to support this
b
@Atharva Joshi @Amol Thite looping here.
a
Hey @Matthew Thomas We have passed this internally and are currently discussing a possible fix Well provide an update as soon as we have one.
Hey @Matthew Thomas We have identified and raised an issue. This will be fixed in the next flutter sdk version. We'll update on this thread when its released
@Matthew Thomas A fix has been released. Please update you flutter sdk to v0.9.14
m
Thank you