mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: CJK user name not allowed in request header
And nanoid in header will be low cased, so do it on my side This fix requires https://github.com/Jermolene/TiddlyWiki5/pull/7471 to be merged to work
This commit is contained in:
parent
be05c33bfa
commit
d24a7519f2
2 changed files with 2 additions and 2 deletions
|
|
@ -110,7 +110,7 @@ export class Authentication implements IAuthenticationService {
|
|||
}
|
||||
|
||||
public generateOneTimeAdminAuthTokenForWorkspace(workspaceID: string): string {
|
||||
const newToken = nanoid();
|
||||
const newToken = nanoid().toLowerCase();
|
||||
this.oneTimeAdminAuthToken.set(workspaceID, newToken);
|
||||
return newToken;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function assignAdminAuthToken(workspaceID: string, details: Electron.OnBeforeSen
|
|||
logger.error(`adminToken is undefined for ${workspaceID}, this should not happen. Skip adding ${TIDGI_AUTH_TOKEN_HEADER}-xxx header for it.`);
|
||||
return;
|
||||
}
|
||||
details.requestHeaders[getTidGiAuthHeaderWithToken(adminToken)] = viewContext.userName;
|
||||
details.requestHeaders[getTidGiAuthHeaderWithToken(adminToken)] = encodeURIComponent(viewContext.userName);
|
||||
}
|
||||
|
||||
function handleFileProtocol(sessionOfView: Electron.Session, nativeService: INativeService) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue