Skip to content

Commit e1bc354

Browse files
committed
Merge pull request FirebaseExtended#89 from proppy/fix-ctor
firebase: fix ctor
2 parents ee9644c + 24d0f82 commit e1bc354

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include <Firebase.h>
2121

2222
// create firebase client.
23-
Firebase fbase = Firebase("example.firebaseio.com")
24-
.auth("secret_or_token");
23+
Firebase fbase("example.firebaseio.com", "secret_or_token");
24+
2525
void setup() {
2626
Serial.begin(9600);
2727

src/Firebase.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,10 @@ String makeFirebaseURL(const String& path, const String& auth) {
4040

4141
} // namespace
4242

43-
Firebase::Firebase(const String& host) : host_(host) {
43+
Firebase::Firebase(const String& host, const String& auth) : host_(host), auth_(auth) {
4444
http_.setReuse(true);
4545
}
4646

47-
Firebase& Firebase::auth(const String& auth) {
48-
auth_ = auth;
49-
return *this;
50-
}
51-
5247
FirebaseGet Firebase::get(const String& path) {
5348
return FirebaseGet(host_, auth_, path, &http_);
5449
}

src/Firebase.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class FirebaseStream;
3535
// Firebase REST API client.
3636
class Firebase {
3737
public:
38-
Firebase(const String& host);
39-
Firebase& auth(const String& auth);
38+
Firebase(const String& host, const String& auth = "");
4039

4140
// Fetch json encoded `value` at `path`.
4241
FirebaseGet get(const String& path);

0 commit comments

Comments
 (0)