From 308acc09bfaf6dabf4b6d5f5e39f33854df8ce34 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Wed, 21 Mar 2018 11:04:40 -0400 Subject: Change CredentialsProvider::TokenListener to use StatusOr (#945) * Change CredentialsProvider::TokenListener to use StatusOr Rather than a token plus error code/msg. * Eliminate the concept of an invalid Token Instead, we'll just use StatusOr. Note that unauthenticated tokens are handled as a special case; they're created via: Token::Unauthenticated() and are otherwise "valid", though attempting to retrieve the raw token on one of these tokens will cause an assertion failure. --- Firestore/core/src/firebase/firestore/auth/credentials_provider.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Firestore/core/src/firebase/firestore/auth/credentials_provider.h') diff --git a/Firestore/core/src/firebase/firestore/auth/credentials_provider.h b/Firestore/core/src/firebase/firestore/auth/credentials_provider.h index b9a8a24..1aa76df 100644 --- a/Firestore/core/src/firebase/firestore/auth/credentials_provider.h +++ b/Firestore/core/src/firebase/firestore/auth/credentials_provider.h @@ -23,6 +23,7 @@ #include "Firestore/core/include/firebase/firestore/firestore_errors.h" #include "Firestore/core/src/firebase/firestore/auth/token.h" #include "Firestore/core/src/firebase/firestore/auth/user.h" +#include "Firestore/core/src/firebase/firestore/util/statusor.h" #include "absl/strings/string_view.h" namespace firebase { @@ -30,12 +31,7 @@ namespace firestore { namespace auth { // `TokenErrorListener` is a listener that gets a token or an error. -// token: An auth token as a string, or nullptr if error occurred. -// error_code: The error code if one occurred, or else FirestoreErrorCode::Ok. -// error_msg: The error if one occurred, or else nullptr. -typedef std::function - TokenListener; +typedef std::function)> TokenListener; // Listener notified with a User change. typedef std::function UserChangeListener; -- cgit v1.2.3