From 200262fe91aca7da5247982ff2413b3e78dd71ce Mon Sep 17 00:00:00 2001 From: RNVD_MacBook Date: Sat, 27 Jul 2024 02:56:14 +0900 Subject: [PATCH] fix auth bug / consider the auth test code / change url_econded_token variable optional --- lib/src/models/auth-token.dart | 4 ++-- lib/src/services/auth.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/models/auth-token.dart b/lib/src/models/auth-token.dart index 793e227..bfba5d2 100644 --- a/lib/src/models/auth-token.dart +++ b/lib/src/models/auth-token.dart @@ -1,12 +1,12 @@ class AuthToken { /// Authentication token final String token; - final String url_encoded_token; + final String? url_encoded_token; /// Expire date of authentication token final DateTime expires; - AuthToken(this.token, this.url_encoded_token, this.expires); + AuthToken(this.token, this.expires, {this.url_encoded_token} ); } class OnLoginData { diff --git a/lib/src/services/auth.dart b/lib/src/services/auth.dart index 617ee01..36d3408 100644 --- a/lib/src/services/auth.dart +++ b/lib/src/services/auth.dart @@ -53,7 +53,7 @@ class AuthService { _authenticated = (ctrl.code ?? 0) >= 200 && (ctrl.code ?? 0) < 300; if (params['token'] != null && params['expires'] != null) { - _authToken = AuthToken(params['token'], Uri.encodeComponent(params['token']), DateTime.parse(params['expires'])); + _authToken = AuthToken(params['token'], DateTime.parse(params['expires']), url_encoded_token: Uri.encodeComponent(params['token'])); } else { _authToken = null;