mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
32 lines
973 B
Objective-C
32 lines
973 B
Objective-C
//
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
#import "TSAccountManager.h"
|
|
#import "TSAttributes.h"
|
|
#import "TSConstants.h"
|
|
#import "TSVerifyCodeRequest.h"
|
|
|
|
@implementation TSVerifyCodeRequest
|
|
|
|
- (TSRequest *)initWithVerificationCode:(NSString *)verificationCode
|
|
forNumber:(NSString *)phoneNumber
|
|
signalingKey:(NSString *)signalingKey
|
|
authKey:(NSString *)authKey {
|
|
self = [super
|
|
initWithURL:[NSURL URLWithString:[NSString
|
|
stringWithFormat:@"%@/code/%@", textSecureAccountsAPI, verificationCode]]];
|
|
|
|
NSDictionary *attributes =
|
|
[TSAttributes attributesWithSignalingKey:signalingKey serverAuthToken:authKey manualMessageFetching:NO];
|
|
|
|
_numberToValidate = phoneNumber;
|
|
[self.parameters addEntriesFromDictionary:attributes];
|
|
|
|
[self setHTTPMethod:@"PUT"];
|
|
|
|
return self;
|
|
}
|
|
|
|
@end
|