mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Improve the look and behavior of /welcome/teams page (also shown for /welcome/start)
Summary: - Move css module for the login page css to core/, to be reusable in core/ pages. - Move /welcome/teams implementation to WelcomeSitePicker.ts - List users for personal sites, as well as team sites. - Add org param to setSessionActive() API method and end endpoint, to allow switching the specified org to another user. - Add a little safety to getOrgUrl() function. Test Plan: Added a test case for the new behaviors of the /welcome/teams page. Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3914
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {ApiError} from 'app/common/ApiError';
|
||||
import {DEFAULT_HOME_SUBDOMAIN, isOrgInPathOnly, parseSubdomain} from 'app/common/gristUrls';
|
||||
import {DEFAULT_HOME_SUBDOMAIN, isOrgInPathOnly, parseSubdomain, sanitizePathTail} from 'app/common/gristUrls';
|
||||
import * as gutil from 'app/common/gutil';
|
||||
import {DocScope, QueryResult, Scope} from 'app/gen-server/lib/HomeDBManager';
|
||||
import {getUserId, RequestWithLogin} from 'app/server/lib/Authorizer';
|
||||
@@ -70,7 +70,8 @@ export function addOrgToPath(req: RequestWithOrg, path: string): string {
|
||||
* Get url to the org associated with the request.
|
||||
*/
|
||||
export function getOrgUrl(req: Request, path: string = '/') {
|
||||
return getOriginUrl(req) + addOrgToPathIfNeeded(req, path);
|
||||
// Be careful to include a leading slash in path, to ensure we don't modify the origin or org.
|
||||
return getOriginUrl(req) + addOrgToPathIfNeeded(req, sanitizePathTail(path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user