docs: about tokenAuth

This commit is contained in:
linonetwo 2023-05-20 23:59:58 +08:00
parent 9f4a127fc4
commit 064aab95d2
2 changed files with 5 additions and 0 deletions

View file

@ -44,6 +44,9 @@ function assignFakeUserAgent(details: Electron.OnBeforeSendHeadersListenerDetail
details.requestHeaders['User-Agent'] = FAKE_USER_AGENT;
}
/**
* Work with tokenAuthenticateArguments in wikiWorker, see there for detail.
*/
function assignAdminAuthToken(workspaceID: string, details: Electron.OnBeforeSendHeadersListenerDetails, authService: IAuthenticationService, viewContext: IViewSessionContext) {
const adminToken = authService.getOneTimeAdminAuthTokenForWorkspaceSync(workspaceID);
if (adminToken === undefined) {

View file

@ -82,6 +82,8 @@ function startNodeJSWiki({
* For example, when server starts with `"readers=s0me7an6om3ey" writers=s0me7an6om3ey" authenticated-user-header=x-tidgi-auth-token`, only when other app query with header `x-tidgi-auth-token: s0me7an6om3ey`, can it get access to the wiki.
*
* When this is not enabled, provide a `anon-username` for any users.
*
* @url https://github.com/Jermolene/TiddlyWiki5/discussions/7469
*/
let tokenAuthenticateArguments: string[] = [`anon-username=${userName}`];
if (tokenAuth === true) {