From 481dfe13d0a80c7d7ccc41ecb2f826ab710baaa5 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Fri, 6 Oct 2023 14:56:16 +0545 Subject: [PATCH] Made scope parameter compulsary for id_token only --- .../cubit/qr_code_scan_cubit.dart | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart b/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart index b6d391714..a2ce80814 100644 --- a/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart +++ b/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart @@ -605,17 +605,6 @@ class QRCodeScanCubit extends Cubit { } } - final scope = state.uri!.queryParameters['scope']; - if (scope == null || scope != 'openid') { - throw ResponseMessage( - data: { - 'error': 'invalid_request', - 'error_description': - 'The openid scope is required in the scope list.', - }, - ); - } - final redirectUri = state.uri!.queryParameters['redirect_uri']; final clientId = state.uri!.queryParameters['client_id']; final isUrl = isURL(clientId.toString()); @@ -624,6 +613,17 @@ class QRCodeScanCubit extends Cubit { if (responseType == 'id_token') { /// verifier side (siopv2) + final scope = state.uri!.queryParameters['scope']; + if (scope == null || scope != 'openid') { + throw ResponseMessage( + data: { + 'error': 'invalid_request', + 'error_description': + 'The openid scope is required in the scope list.', + }, + ); + } + if (redirectUri == null) { throw ResponseMessage( data: {