main
Bob Mottram 2020-08-30 15:44:50 +01:00
parent 3bcb634863
commit 149acb0c4d
1 changed files with 13 additions and 22 deletions

View File

@ -1222,33 +1222,25 @@ class PubServer(BaseHTTPRequestHandler):
if loginNickname: if loginNickname:
self.server.lastLoginTime = int(time.time()) self.server.lastLoginTime = int(time.time())
if register: if register:
if not registerAccount(baseDir, if not registerAccount(baseDir, httpPrefix, domain, port,
httpPrefix, loginNickname, loginPassword,
domain,
port,
loginNickname,
loginPassword,
self.server.manualFollowerApproval): self.server.manualFollowerApproval):
self.server.POSTbusy = False self.server.POSTbusy = False
if callingDomain.endswith('.onion') and onionDomain: if callingDomain.endswith('.onion') and onionDomain:
self._redirect_headers('http://' + self._redirect_headers('http://' + onionDomain +
onionDomain + '/login', cookie,
'/login', callingDomain)
cookie, callingDomain)
elif (callingDomain.endswith('.i2p') and i2pDomain): elif (callingDomain.endswith('.i2p') and i2pDomain):
self._redirect_headers('http://' + self._redirect_headers('http://' + i2pDomain +
i2pDomain + '/login', cookie,
'/login', callingDomain)
cookie, callingDomain)
else: else:
self._redirect_headers(httpPrefix + self._redirect_headers(httpPrefix + '://' +
'://' + domainFull + '/login',
domainFull +
'/login',
cookie, callingDomain) cookie, callingDomain)
return return
authHeader = createBasicAuthHeader(loginNickname, authHeader = \
loginPassword) createBasicAuthHeader(loginNickname, loginPassword)
if not authorizeBasic(baseDir, '/users/' + if not authorizeBasic(baseDir, '/users/' +
loginNickname + '/outbox', loginNickname + '/outbox',
authHeader, False): authHeader, False):
@ -1328,8 +1320,7 @@ class PubServer(BaseHTTPRequestHandler):
cookieStr, callingDomain) cookieStr, callingDomain)
else: else:
self._redirect_headers(httpPrefix + '://' + self._redirect_headers(httpPrefix + '://' +
domainFull + domainFull + '/users/' +
'/users/' +
loginNickname + '/' + loginNickname + '/' +
self.server.defaultTimeline, self.server.defaultTimeline,
cookieStr, callingDomain) cookieStr, callingDomain)