forked from cory/tildefriends
This simplifies upgrading an HTTP request to a websocket, I believe, and fixes sending refresh auth tokens.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4791 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -202,11 +202,9 @@ function socket(request, response, client) {
|
||||
}
|
||||
}
|
||||
|
||||
if (refresh) {
|
||||
return {
|
||||
'Set-Cookie': `session=${refresh.token}; path=/; Max-Age=${refresh.interval}; Secure; SameSite=Strict`,
|
||||
};
|
||||
}
|
||||
response.upgrade(100, refresh ? {
|
||||
'Set-Cookie': `session=${refresh.token}; path=/; Max-Age=${refresh.interval}; Secure; SameSite=Strict`,
|
||||
} : {});
|
||||
}
|
||||
|
||||
export { socket, App };
|
||||
|
@ -982,7 +982,7 @@ loadSettings().then(function() {
|
||||
httpd.set_http_redirect(gGlobalSettings.http_redirect);
|
||||
}
|
||||
httpd.all("/login", auth.handler);
|
||||
httpd.registerSocketHandler("/app/socket", app.socket);
|
||||
httpd.all("/app/socket", app.socket);
|
||||
httpd.all("", function(request, response) {
|
||||
let match;
|
||||
if (request.uri === "/" || request.uri === "") {
|
||||
|
Reference in New Issue
Block a user