|
1 |
| -import 'package:flutter/material.dart'; |
2 | 1 | import 'package:flutter_web_auth/flutter_web_auth.dart';
|
3 | 2 | import 'package:http/http.dart' as http;
|
4 | 3 | import 'package:jose/jose.dart';
|
@@ -70,12 +69,7 @@ class LogtoClient {
|
70 | 69 |
|
71 | 70 | bool _loading = false;
|
72 | 71 |
|
73 |
| - Future<void> signIn( |
74 |
| - String redirectUri, { |
75 |
| - Color? primaryColor, |
76 |
| - Color? backgroundColor, |
77 |
| - Widget? title, |
78 |
| - }) async { |
| 72 | + Future<void> signIn(String redirectUri) async { |
79 | 73 | if (_loading) throw Exception('Already signing in...');
|
80 | 74 | final httpClient = _httpClient ?? http.Client();
|
81 | 75 |
|
@@ -155,9 +149,7 @@ class LogtoClient {
|
155 | 149 | expiresIn: tokenResponse.expiresIn);
|
156 | 150 | }
|
157 | 151 |
|
158 |
| - Future<void> signOut({ |
159 |
| - String? redirectUri, |
160 |
| - }) async { |
| 152 | + Future<void> signOut() async { |
161 | 153 | // Throw error is authentication status not found
|
162 | 154 | final idToken = await _tokenStorage.idToken;
|
163 | 155 |
|
@@ -187,25 +179,7 @@ class LogtoClient {
|
187 | 179 | }
|
188 | 180 | }
|
189 | 181 |
|
190 |
| - final postLogoutRedirectUri = |
191 |
| - redirectUri == null ? null : Uri.parse(redirectUri); |
192 |
| - |
193 |
| - final signOutUri = logto_core.generateSignOutUri( |
194 |
| - endSessionEndpoint: oidcConfig.endSessionEndpoint, |
195 |
| - idToken: idToken.serialization, |
196 |
| - postLogoutRedirectUri: postLogoutRedirectUri, |
197 |
| - ); |
198 |
| - |
199 | 182 | await _tokenStorage.clear();
|
200 |
| - |
201 |
| - if (postLogoutRedirectUri != null) { |
202 |
| - await FlutterWebAuth.authenticate( |
203 |
| - url: signOutUri.toString(), |
204 |
| - callbackUrlScheme: postLogoutRedirectUri.scheme, |
205 |
| - ); |
206 |
| - } else { |
207 |
| - await httpClient.get(signOutUri); |
208 |
| - } |
209 | 183 | } finally {
|
210 | 184 | if (_httpClient == null) {
|
211 | 185 | httpClient.close();
|
|
0 commit comments