Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Added logging in with Meteor username #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Meteor/METDDPClient+AccountsPassword.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN

- (void)loginWithEmail:(NSString *)email password:(NSString *)password completionHandler:(nullable METLogInCompletionHandler)completionHandler;

- (void)loginWithUsername:(NSString *)username password:(NSString *)password completionHandler:(nullable METLogInCompletionHandler)completionHandler;

/// @name Signing Up with Password

- (void)signUpWithEmail:(NSString *)email password:(NSString *)password completionHandler:(nullable METLogInCompletionHandler)completionHandler;
Expand Down
4 changes: 4 additions & 0 deletions Meteor/METDDPClient+AccountsPassword.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ - (void)loginWithEmail:(NSString *)email password:(NSString *)password completio
[self loginWithMethodName:@"login" parameters:@[@{@"user": @{@"email": email}, @"password": @{@"digest": [password SHA256String], @"algorithm": @"sha-256"}}] completionHandler:completionHandler];
}

- (void)loginWithUsername:(NSString *)username password:(NSString *)password completionHandler:(METLogInCompletionHandler)completionHandler {
[self loginWithMethodName:@"login" parameters:@[@{@"user": @{@"username": username}, @"password": @{@"digest": [password SHA256String], @"algorithm": @"sha-256"}}] completionHandler:completionHandler];
}

- (void)signUpWithEmail:(NSString *)email password:(NSString *)password completionHandler:(METLogInCompletionHandler)completionHandler {
[self signUpWithEmail:email password:password profile:nil completionHandler:completionHandler];
}
Expand Down