mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-27 07:36:01 +00:00
feat (PUT-1025 PUT-1026 and PUT-1017): better handling old token auth required in gui (#3166)
* feat (PUT-1025 PUT-1026 and PUT-1017): better handling old token forcing in gui * fix: misc issues with token inval project
This commit is contained in:
@@ -315,7 +315,18 @@ export class SocketService extends PuterService {
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await authService.authenticate(token);
|
||||
const handshakeHeaders =
|
||||
(socket.handshake.headers as
|
||||
| Record<string, string | string[] | undefined>
|
||||
| undefined) ?? {};
|
||||
const uaHeader = handshakeHeaders['user-agent'];
|
||||
const userAgent = Array.isArray(uaHeader)
|
||||
? uaHeader[0]
|
||||
: uaHeader;
|
||||
const result = await authService.authenticate(token, {
|
||||
ip: socket.handshake.address,
|
||||
userAgent: userAgent ?? undefined,
|
||||
});
|
||||
|
||||
if (result.reauth) {
|
||||
console.info(
|
||||
|
||||
Reference in New Issue
Block a user