I'm getting this exception while trying to reset the password of a user:
E/flutter (12035): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ApiException: apiUrl=https://jixoaoumojenusgmwtfd.nhost.run/v1/auth/user/password/reset, statusCode=400, responseBody={status: 400, message: The value of "options.redirectTo" is not allowed., error: invalid-request}
E/flutter (12035): #0 ApiClient._handleResponse (package:nhost_sdk/src/api/api_client.dart:281:7)
E/flutter (12035): #1 ApiClient.send (package:nhost_sdk/src/api/api_client.dart:240:12)
E/flutter (12035): <asynchronous suspension>
E/flutter (12035): #2 AuthClient.resetPassword (package:nhost_sdk/src/auth_client.dart:450:5)
E/flutter (12035): <asynchronous suspension>
E/flutter (12035): #3 LoginEmailForgotController.submit (package:app/pages/login_email_forgot.dart:23:5)
E/flutter (12035): <asynchronous suspension>
E/flutter (12035):
The code (at trace # 3) is the following submit method in my controller:
Future<void> submit() async {
NHostController nhc = Get.find();
await nhc.client.auth.resetPassword(
email: emailCtrl.value.text.trim(),
redirectTo: '/app/login_email_forgot_change');
}
I think the code already complies with the usage of redirectTo
as specified in the JavaScript reference.
But for some reason it's still failing. The logs at NHost dashboard are very limited and not quite useful:
2022-12-22 16:04:27 | hasura-auth | {"latencyInNs":4000000,"level":"info","message":"POST /user/password/reset 400 4ms","method":"POST","statusCode":400,"url":"/user/password/reset"}
2022-12-22 16:03:25 | hasura-auth | {"latencyInNs":16000000,"level":"info","message":"POST /user/password/reset 400 16ms","method":"POST","statusCode":400,"url":"/user/password/reset"}
Any pointers?
bug