aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Auth/FSTCredentialsProvider.h
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/Source/Auth/FSTCredentialsProvider.h
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/Source/Auth/FSTCredentialsProvider.h')
-rw-r--r--Firestore/Source/Auth/FSTCredentialsProvider.h34
1 files changed, 4 insertions, 30 deletions
diff --git a/Firestore/Source/Auth/FSTCredentialsProvider.h b/Firestore/Source/Auth/FSTCredentialsProvider.h
index 230a22d..d2f04e0 100644
--- a/Firestore/Source/Auth/FSTCredentialsProvider.h
+++ b/Firestore/Source/Auth/FSTCredentialsProvider.h
@@ -16,6 +16,7 @@
#import <Foundation/Foundation.h>
+#include "Firestore/core/src/firebase/firestore/auth/token.h"
#include "Firestore/core/src/firebase/firestore/auth/user.h"
NS_ASSUME_NONNULL_BEGIN
@@ -23,46 +24,19 @@ NS_ASSUME_NONNULL_BEGIN
@class FIRApp;
@class FSTDispatchQueue;
-#pragma mark - FSTGetTokenResult
-
-/**
- * The current User and the authentication token provided by the underlying authentication
- * mechanism. This is the result of calling -[FSTCredentialsProvider getTokenForcingRefresh].
- *
- * ## Portability notes: no TokenType on iOS
- *
- * The TypeScript client supports 1st party Oauth tokens (for the Firebase Console to auth as the
- * developer) and OAuth2 tokens for the node.js sdk to auth with a service account. We don't have
- * plans to support either case on mobile so there's no TokenType here.
- */
-// TODO(mcg): Rename FSTToken, change parameter order to line up with the other platforms.
-@interface FSTGetTokenResult : NSObject
-
-- (instancetype)init NS_UNAVAILABLE;
-- (instancetype)initWithUser:(const firebase::firestore::auth::User &)user
- token:(NSString *_Nullable)token NS_DESIGNATED_INITIALIZER;
-
-/** The user with which the token is associated (used for persisting user state on disk, etc.). */
-@property(nonatomic, assign, readonly) const firebase::firestore::auth::User &user;
-
-/** The actual raw token. */
-@property(nonatomic, copy, nullable, readonly) NSString *token;
-
-@end
-
#pragma mark - Typedefs
/**
* `FSTVoidTokenErrorBlock` is a block that gets a token or an error.
*
- * @param token An auth token as a string.
+ * @param token An auth token, either valid or invalid when error occurred.
* @param error The error if one occurred, or else `nil`.
*/
-typedef void (^FSTVoidGetTokenResultBlock)(FSTGetTokenResult *_Nullable token,
+typedef void (^FSTVoidGetTokenResultBlock)(firebase::firestore::auth::Token token,
NSError *_Nullable error);
/** Listener block notified with a User. */
-typedef void (^FSTVoidUserBlock)(const firebase::firestore::auth::User &user);
+typedef void (^FSTVoidUserBlock)(firebase::firestore::auth::User user);
#pragma mark - FSTCredentialsProvider