123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
-
-
- #import "FIRResetPasswordRequest.h"
-
- NS_ASSUME_NONNULL_BEGIN
-
-
- static NSString *const kResetPasswordEndpoint = @"resetPassword";
-
-
- static NSString *const kOOBCodeKey = @"oobCode";
-
-
- static NSString *const kCurrentPasswordKey = @"newPassword";
-
- @implementation FIRResetPasswordRequest
-
- - (nullable instancetype)initWithOobCode:(NSString *)oobCode
- newPassword:(nullable NSString *)newPassword
- requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration {
- self = [super initWithEndpoint:kResetPasswordEndpoint requestConfiguration:requestConfiguration];
- if (self) {
- _oobCode = oobCode;
- _updatedPassword = newPassword;
- }
- return self;
- }
-
- - (nullable id)unencodedHTTPRequestBodyWithError:(NSError *_Nullable *_Nullable)error {
- NSMutableDictionary *postBody = [NSMutableDictionary dictionary];
- postBody[kOOBCodeKey] = _oobCode;
- if (_updatedPassword) {
- postBody[kCurrentPasswordKey] = _updatedPassword;
- }
- return postBody;
- }
-
- @end
-
- NS_ASSUME_NONNULL_END
|