Skip to content

Commit

Permalink
Fix the id token refreshment infinite loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Mar 14, 2021
1 parent f0c0526 commit be58be5
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Firebase Arduino Client Library for ESP8266 and ESP32


Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.6
Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.7


This library supports ESP8266 and ESP32 MCU from Espressif. The following are platforms in which the libraries are also available (RTDB only).
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Firebase Arduino Client Library for ESP8266 and ESP32",
"version": "2.0.6",
"version": "2.0.7",
"keywords": "communication, REST, esp32, esp8266, arduino",
"description": "This client library provides the functions to work with Firebase Realtime database, Firestore, Storage and Cloud messaging.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=Firebase Arduino Client Library for ESP8266 and ESP32

version=2.0.6
version=2.0.7

author=Mobizt

Expand Down
4 changes: 2 additions & 2 deletions src/Firebase_ESP_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.6
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.7
*
* This library supports Espressif ESP8266 and ESP32
*
* Created March 11, 2021
* Created March 14, 2021
*
* This work is a part of Firebase ESP Client library
* Copyright (c) 2020, 2021 K. Suwatchai (Mobizt)
Expand Down
4 changes: 2 additions & 2 deletions src/Firebase_ESP_Client.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.6
* Google's Firebase ESP Client Main class, Firebase_ESP_Client.h version 2.0.7
*
* This library supports Espressif ESP8266 and ESP32
*
* Created March 11, 2021
* Created March 14, 2021
*
* This work is a part of Firebase ESP Client library
* Copyright (c) 2020, 2021 K. Suwatchai (Mobizt)
Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Firebase Arduino Client Library for ESP8266 and ESP32


Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.6
Google's Firebase Arduino Client Library for ESP8266 and ESP32 v 2.0.7


The default filessystem used in the library is flash and SD.
Expand Down
4 changes: 2 additions & 2 deletions src/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* This library supports Espressif ESP8266 and ESP32
*
* Created March 11, 2021
* Created March 13, 2021
*
* This work is a part of Firebase ESP Client library
* Copyright (c) 2021, 2021 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -1411,7 +1411,7 @@ class UtilsClass
bool flashTest()
{
#if defined(ESP32)
if (FORMAT_SPIFFS == 1)
if (FORMAT_FLASH == 1)
config->_int.fb_flash_rdy = FLASH_FS.begin(true);
else
config->_int.fb_flash_rdy = FLASH_FS.begin();
Expand Down
11 changes: 5 additions & 6 deletions src/signer/Signer.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Google's Firebase Token Generation class, Signer.cpp version 1.0.3
* Google's Firebase Token Generation class, Signer.cpp version 1.0.4
*
* This library supports Espressif ESP8266 and ESP32
*
* Created March 13, 2021
* Created March 14, 2021
*
* This work is a part of Firebase ESP Client library
* Copyright (c) 2020, 2021 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -216,10 +216,6 @@ bool Firebase_Signer::handleToken()
config->signer.lastReqMillis = millis();
if (config->_int.fb_processing)
return false;
config->signer.tokens.status = token_status_on_refresh;
config->signer.tokens.error.code = 0;
config->signer.tokens.error.message.clear();
sendTokenStatusCB();
return refreshToken();
}
return false;
Expand Down Expand Up @@ -481,6 +477,9 @@ bool Firebase_Signer::refreshToken()

config->signer.tokens.status = token_status_on_refresh;
config->_int.fb_processing = true;
config->signer.tokens.error.code = 0;
config->signer.tokens.error.message.clear();
sendTokenStatusCB();

config->signer.tokens.id_token.clear();
config->signer.tokens.access_token.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/signer/Signer.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Google's Firebase Token Generation class, Signer.h version 1.0.3
* Google's Firebase Token Generation class, Signer.h version 1.0.4
*
* This library supports Espressif ESP8266 and ESP32
*
* Created March 13, 2021
* Created March 14, 2021
*
* This work is a part of Firebase ESP Client library
* Copyright (c) 2020, 2021 K. Suwatchai (Mobizt)
Expand Down
2 changes: 1 addition & 1 deletion src/wcs/esp32/FB_HTTPClient32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void FB_HTTPClient32::setCACertFile(const char *caCertFile, uint8_t storageType,
File f;
if (storageType == 1)
{
if (FORMAT_SPIFFS == 1)
if (FORMAT_FLASH == 1)
FLASH_FS.begin(true);
else
FLASH_FS.begin();
Expand Down
2 changes: 1 addition & 1 deletion src/wcs/esp32/FB_HTTPClient32.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#define FLASH_FS DEFAULT_FLASH_FS
#define SD_FS DEFAULT_SD_FS
#define FORMAT_SPIFFS FORMAT_FLASH_IF_MOUNT_FAILED
#define FORMAT_FLASH FORMAT_FLASH_IF_MOUNT_FAILED

#include "wcs/HTTPCode.h"

Expand Down

0 comments on commit be58be5

Please sign in to comment.