Permalink
Browse files

Change BrowserID login path to /db/_browserid, for Sync Gateway.

  • Loading branch information...
1 parent 78a2ad7 commit b620e129aa043c3857d98eec0ecfd36550f46a0b @snej snej committed Mar 18, 2013
Showing with 7 additions and 6 deletions.
  1. +1 −1 Source/TDAuthorizer.h
  2. +1 −1 Source/TDAuthorizer.m
  3. +2 −2 Source/TDBrowserIDAuthorizer.m
  4. +3 −2 Source/TDReplicator.m
View
2 Source/TDAuthorizer.h
@@ -22,7 +22,7 @@
@optional
-@property (readonly) NSString* loginPath;
+- (NSString*) loginPathForSite: (NSURL*)site;
- (NSDictionary*) loginParametersForSite: (NSURL*)site;
@end
View
2 Source/TDAuthorizer.m
@@ -77,7 +77,7 @@ - (NSString*) description {
// but there's not really much point in doing so, as such logins expire, which would cause trouble
// with long-lived replications.
-- (NSString*) loginPath {
+- (NSString*) loginPathForSite: (NSURL*)site {
return @"/_session";
}
View
4 Source/TDBrowserIDAuthorizer.m
@@ -125,8 +125,8 @@ - (NSString*) authorizeHTTPMessage: (CFHTTPMessageRef)message
}
-- (NSString*) loginPath {
- return @"/_browserid";
+- (NSString*) loginPathForSite:(NSURL *)site {
+ return [site.path stringByAppendingPathComponent: @"_browserid"];
}
View
5 Source/TDReplicator.m
@@ -475,10 +475,11 @@ - (void) login {
return;
}
- LogTo(Sync, @"%@: Logging in with %@ at %@ ...", self, _authorizer.class, _authorizer.loginPath);
+ NSString* loginPath = [_authorizer loginPathForSite: _remote];
+ LogTo(Sync, @"%@: Logging in with %@ at %@ ...", self, _authorizer.class, loginPath);
[self asyncTaskStarted];
[self sendAsyncRequest: @"POST"
- path: _authorizer.loginPath
+ path: loginPath
body: loginParameters
onCompletion: ^(id result, NSError *error) {
if (error) {

0 comments on commit b620e12

Please sign in to comment.