From f46f71597aef92e9c1b047086b161d09d6ed9d58 Mon Sep 17 00:00:00 2001 From: Garrett Bischof Date: Sun, 22 Dec 2024 16:00:14 -0500 Subject: [PATCH] touch ups --- lib/core/auth/bloc/auth_bloc.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/auth/bloc/auth_bloc.dart b/lib/core/auth/bloc/auth_bloc.dart index 51fafb07f..134f23419 100644 --- a/lib/core/auth/bloc/auth_bloc.dart +++ b/lib/core/auth/bloc/auth_bloc.dart @@ -250,8 +250,7 @@ class AuthBloc extends Bloc { // Extract the code from the response. String code = Uri.parse(providerResponse.uri.toString()).queryParameters['code'] ?? "failed"; - debugPrint("CODE"); - debugPrint(code); + debugPrint("CODE $code"); if (code == "failed") { throw Exception("OAuth login failed: no code received from provider."); @@ -259,7 +258,7 @@ class AuthBloc extends Bloc { // TODO: This should use lemmy_api_client. // Authenthicate to lemmy and get a jwt. - // Durring this step lemmy with connect to the Provider to get the user info. + // Durring this step lemmy connects to the Provider to get the user info. final response = await http.post(Uri.parse('https://$instance/api/v3/oauth/authenticate'), headers: { 'Content-Type': 'application/json', @@ -271,10 +270,11 @@ class AuthBloc extends Bloc { }), encoding: Encoding.getByName('utf-8')); + // TODO: Need to add a step to set the account username. + final accessToken = jsonDecode(response.body)['jwt'] as String; - debugPrint("JWT"); - debugPrint(accessToken); + debugPrint("JWT $accessToken"); GetSiteResponse getSiteResponse = await lemmy.run(GetSite(auth: accessToken));