updateMagicURLSession method

Future<Session> updateMagicURLSession({
  1. required String userId,
  2. required String secret,
})

Create Magic URL session (confirmation)

Use this endpoint to complete creating the session with the Magic URL. Both the userId and secret arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the POST /account/sessions/magic-url endpoint.

Please note that in order to avoid a Redirect Attack the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

Implementation

Future<models.Session> updateMagicURLSession(
    {required String userId, required String secret}) async {
  const String path = '/account/sessions/magic-url';

  final Map<String, dynamic> params = {
    'userId': userId,
    'secret': secret,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.put,
      path: path, params: params, headers: headers);

  return models.Session.fromMap(res.data);
}