From 917f20eddb4c255ed80e482ce1971340835daa38 Mon Sep 17 00:00:00 2001 From: suwatchai Date: Tue, 1 Mar 2022 16:57:05 +0700 Subject: [PATCH] Fixed legacy token authentication issue. --- README.md | 2 +- library.json | 2 +- library.properties | 2 +- src/Firebase_ESP_Client.h | 10 ++++------ src/README.md | 2 +- src/session/FB_Session.cpp | 10 ++++++++-- src/session/FB_Session.h | 4 ++-- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 376cf2d60..45b1e4553 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Firebase Arduino Client Library for ESP8266 and ESP32 -Google's Firebase Arduino Client Library for ESP8266 and ESP32 v3.1.3 +Google's Firebase Arduino Client Library for ESP8266 and ESP32 v3.1.4 This library supports ESP8266 and ESP32 MCU from Espressif. The following are platforms in which the libraries are also available (RTDB only). diff --git a/library.json b/library.json index eeb3c0531..7bc100ca9 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Firebase Arduino Client Library for ESP8266 and ESP32", - "version": "3.1.3", + "version": "3.1.4", "keywords": "communication, REST, esp32, esp8266, arduino", "description": "The library supports Firebase products e.g. Realtime database, Cloud Firestore database, Firebase Storage and Google Cloud Storage, Cloud Functions for Firebase and Cloud Messaging. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.", "repository": { diff --git a/library.properties b/library.properties index febe2f448..972648ece 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=Firebase Arduino Client Library for ESP8266 and ESP32 -version=3.1.3 +version=3.1.4 author=Mobizt diff --git a/src/Firebase_ESP_Client.h b/src/Firebase_ESP_Client.h index 6617594b8..41ce9ae6a 100644 --- a/src/Firebase_ESP_Client.h +++ b/src/Firebase_ESP_Client.h @@ -1,18 +1,16 @@ #ifndef FIREBASE_CLIENT_VERSION -#define FIREBASE_CLIENT_VERSION "3.1.3" +#define FIREBASE_CLIENT_VERSION "3.1.4" #endif /** - * Google's Firebase ESP Client Main class, Firebase_ESP_Client.h v3.1.3 + * Google's Firebase ESP Client Main class, Firebase_ESP_Client.h v3.1.4 * * This library supports Espressif ESP8266 and ESP32 MCUs * - * Created February 28, 2022 + * Created March 1, 2022 * * Updates: - * - Fixed multiPathStream task execution issue #256. - * - Fixed Arduino IDE compiler waring. - * - Update printf functions. + * - Fixed legacy token authentication issue. * * * This work is a part of Firebase ESP Client library diff --git a/src/README.md b/src/README.md index a13725941..d431a0283 100644 --- a/src/README.md +++ b/src/README.md @@ -1,7 +1,7 @@ # Firebase Arduino Client Library for ESP8266 and ESP32 -Google's Firebase Arduino Client Library for ESP8266 and ESP32 v3.1.3 +Google's Firebase Arduino Client Library for ESP8266 and ESP32 v3.1.4 The default filessystem used in the library is flash and SD. diff --git a/src/session/FB_Session.cpp b/src/session/FB_Session.cpp index 0152401de..c102b6038 100644 --- a/src/session/FB_Session.cpp +++ b/src/session/FB_Session.cpp @@ -1,9 +1,9 @@ /** - * Google's Firebase Data class, FB_Session.cpp version 1.2.18 + * Google's Firebase Data class, FB_Session.cpp version 1.2.19 * * This library supports Espressif ESP8266 and ESP32 * - * Created February 28, 2022 + * Created March 1, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2022 K. Suwatchai (Mobizt) @@ -1003,6 +1003,12 @@ void FirebaseData::setCert(const char *ca) bool FirebaseData::tokenReady() { + if (Signer.getCfg()) + { + if (Signer.getCfg()->signer.test_mode || (Signer.getCfg()->signer.tokens.token_type == token_type_legacy_token && Signer.getCfg()->signer.tokens.status == token_status_ready)) + return true; + } + if (Signer.isExpired()) { closeSession(); diff --git a/src/session/FB_Session.h b/src/session/FB_Session.h index 5a8c4a039..b933743f0 100644 --- a/src/session/FB_Session.h +++ b/src/session/FB_Session.h @@ -1,9 +1,9 @@ /** - * Google's Firebase Data class, FB_Session.h version 1.2.18 + * Google's Firebase Data class, FB_Session.h version 1.2.19 * * This library supports Espressif ESP8266 and ESP32 * - * Created February 28, 2022 + * Created March 1, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2022 K. Suwatchai (Mobizt)