aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/auth/token.cc
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-02-20 12:25:39 -0500
committerGravatar GitHub <noreply@github.com>2018-02-20 12:25:39 -0500
commit7a4a2ea10844afd6a58dace46854fae74399f55c (patch)
treebb6115c271d6fac490cb5720a79fcc7de21d2de9 /Firestore/core/src/firebase/firestore/auth/token.cc
parenta9f3f35d483f1031ef2e2860aeda921f56e1bf08 (diff)
replacing FSTGetTokenResult by C++ Token implementation (#805)
* replacing Auth/FSTUser by C++ auth implementation * address changes * replacing FSTGetTokenResult by C++ Token implementation * address changes * address changes * fix another const& v.s. dispatch bug * fix more const& v.s. dispatch bug zxu123 committed * fix * passing by value in callback
Diffstat (limited to 'Firestore/core/src/firebase/firestore/auth/token.cc')
-rw-r--r--Firestore/core/src/firebase/firestore/auth/token.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/Firestore/core/src/firebase/firestore/auth/token.cc b/Firestore/core/src/firebase/firestore/auth/token.cc
index 0618ddb..4ee1b69 100644
--- a/Firestore/core/src/firebase/firestore/auth/token.cc
+++ b/Firestore/core/src/firebase/firestore/auth/token.cc
@@ -21,7 +21,15 @@ namespace firestore {
namespace auth {
Token::Token(const absl::string_view token, const User& user)
- : token_(token), user_(user) {
+ : token_(token), user_(user), is_valid_(true) {
+}
+
+Token::Token() : token_(), user_(User::Unauthenticated()), is_valid_(false) {
+}
+
+const Token& Token::Invalid() {
+ static const Token kInvalidToken;
+ return kInvalidToken;
}
} // namespace auth