Remove nickname

main2
Bob Mottram 2019-10-23 23:32:07 +01:00
parent 204c9905c4
commit 02dcbe006a
1 changed files with 2 additions and 9 deletions

View File

@ -652,13 +652,6 @@ class PubServer(BaseHTTPRequestHandler):
# check authorization # check authorization
authorized = self._isAuthorized() authorized = self._isAuthorized()
if authorized: if authorized:
if self.path=='/':
if cookie and self.headers.get('Nickname'):
self.send_header('Location', '/users/'+self.headers['Nickname']+'/inbox')
self.send_header('Content-Length', '0')
self.send_header('X-Robots-Tag','noindex')
self.end_headers()
return
if self.server.debug: if self.server.debug:
print('GET Authorization granted') print('GET Authorization granted')
else: else:
@ -2824,7 +2817,7 @@ class PubServer(BaseHTTPRequestHandler):
del self.server.salts[loginNickname] del self.server.salts[loginNickname]
self.send_response(303) self.send_response(303)
self.send_header('Content-Length', '0') self.send_header('Content-Length', '0')
self.send_header('Set-Cookie', 'epicyon=; Nickname=; SameSite=Strict') self.send_header('Set-Cookie', 'epicyon=; SameSite=Strict')
self.send_header('Location', '/login') self.send_header('Location', '/login')
self.send_header('X-Robots-Tag','noindex') self.send_header('X-Robots-Tag','noindex')
self.end_headers() self.end_headers()
@ -2850,7 +2843,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.salts[loginNickname]=createPassword(32) self.server.salts[loginNickname]=createPassword(32)
self.server.tokens[loginNickname]=sha256((loginNickname+loginPassword+self.server.salts[loginNickname]).encode('utf-8')).hexdigest() self.server.tokens[loginNickname]=sha256((loginNickname+loginPassword+self.server.salts[loginNickname]).encode('utf-8')).hexdigest()
self.server.tokensLookup[self.server.tokens[loginNickname]]=loginNickname self.server.tokensLookup[self.server.tokens[loginNickname]]=loginNickname
self.send_header('Set-Cookie', 'epicyon='+self.server.tokens[loginNickname]+'; Nickname='+loginNickname+'; SameSite=Strict') self.send_header('Set-Cookie', 'epicyon='+self.server.tokens[loginNickname]+'; SameSite=Strict')
self.send_header('Location', '/users/'+loginNickname+'/inbox') self.send_header('Location', '/users/'+loginNickname+'/inbox')
self.send_header('Content-Length', '0') self.send_header('Content-Length', '0')
self.send_header('X-Robots-Tag','noindex') self.send_header('X-Robots-Tag','noindex')