Skip to content

Commit

Permalink
Merge pull request #32 from shankari/fix_prompted_auth_comments
Browse files Browse the repository at this point in the history
Rename comments and strings from dummy dev to prompted auth
  • Loading branch information
shankari authored Sep 5, 2018
2 parents edb0667 + 0d64c53 commit a27cf38
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/android/AuthTokenCreationFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static AuthTokenCreator getInstance(Context ctxt) {
} else if ("prompted-auth".equals(authMethod)) {
return new PromptedAuth(ctxt);
} else {
// Return dummy dev sign-in handler by default so that:
// Return prompted auth sign-in handler by default so that:
// - we know that this will never return null
// - dev users can start working without any configuration stuff
return new PromptedAuth(ctxt);
Expand Down
10 changes: 5 additions & 5 deletions src/android/PromptedAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* Created by shankari on 8/21/17.
*
* Implementation of the dummy dev auth code to allow developers to login with multiple user IDs
* Implementation of the prompted auth code to allow developers to login with multiple user IDs
* for testing + to provide another exemplar of logging in properly :)
*/

Expand All @@ -25,7 +25,7 @@ class PromptedAuth implements AuthTokenCreator {
private AuthPendingResult mAuthPending;
private Context mCtxt;

private static final String TAG = "DummyDevAuth";
private static final String TAG = "PromptedAuth";
private static final String METHOD_PARAM_KEY = "method";
private static final String TOKEN_PARAM_KEY = "token";
private static final String EXPECTED_HOST = "auth";
Expand Down Expand Up @@ -62,14 +62,14 @@ public AuthPendingResult getUserEmail() {

@Override
public AuthPendingResult getServerToken() {
// For the dummy-dev case, the token is the user email
// For the prompted-auth case, the token is the user email
return readStoredUserAuthEntry(mCtxt);
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(mCtxt, TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data.getDataString());
Log.i(mCtxt, TAG, "onActivityResult unused in `dummy-dev, ignoring call...");
Log.i(mCtxt, TAG, "onActivityResult unused in `prompted-auth, ignoring call...");
}

@Override
Expand Down Expand Up @@ -122,7 +122,7 @@ private AuthPendingResult readStoredUserAuthEntry(Context ctxt) {
private String getPrompt() {
String configPrompt = ConnectionSettings.getAuthValue(mCtxt, "prompt");
if (configPrompt == null) {
// return dummy-dev prompt by default to continue supporting config-less
// return prompted-auth prompt by default to continue supporting config-less
// development
configPrompt = "Dummy dev mode: Enter email";
}
Expand Down
2 changes: 1 addition & 1 deletion src/ios/AuthTokenCreationFactory.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ @implementation AuthTokenCreationFactory
} else if ([settings.authMethod isEqual: @"prompted-auth"]) {
return [PromptedAuth sharedInstance];
} else {
// Return dummy dev sign-in handler by default so that:
// Return prompted auth sign-in handler by default so that:
// - we know that this will never return null
// - dev users can start working without any configuration stuff
return [PromptedAuth sharedInstance];
Expand Down
2 changes: 1 addition & 1 deletion src/ios/OpenIDAuth.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DummyDevAuth.h
// OpenIDAuth.h
// emission
//
// Created by Andrew Tan
Expand Down
2 changes: 1 addition & 1 deletion src/ios/PromptedAuth.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DummyDevAuth.h
// PromptedAuth.h
// emission
//
// Created by Kalyanaraman Shankari on 8/20/17.
Expand Down
6 changes: 3 additions & 3 deletions src/ios/PromptedAuth.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DummyDevAuth.m
// PromptedAuth.m
// emission
//
// Created by Kalyanaraman Shankari on 8/20/17.
Expand Down Expand Up @@ -52,7 +52,7 @@ -(void)handleNotification:(NSNotification *)notification
NSURLQueryItem* tokenParam = queryItems[1];

if (([methodParam.name isEqualToString:METHOD_PARAM_KEY]) && ([methodParam.value isEqualToString:EXPECTED_METHOD])) {
// For the dummy-dev method name
// For the prompted-auth method name
if ([tokenParam.name isEqualToString:TOKEN_PARAM_KEY]) {
NSString* userName = tokenParam.value;
[LocalNotificationManager addNotification:
Expand Down Expand Up @@ -92,7 +92,7 @@ - (void) getEmail:(AuthResultCallback) authResultCallback

- (void) getJWT:(AuthResultCallback) authResultCallback
{
// For the dummy-dev method, token = username
// For the prompted-auth method, token = username
authResultCallback([self getStoredUserAuthEntry], NULL);
}

Expand Down

0 comments on commit a27cf38

Please sign in to comment.