mirror of
https://github.com/tinyauthapp/tinyauth.git
synced 2026-08-31 18:43:31 +08:00
fix: make login_for optional
This commit is contained in:
@@ -27,16 +27,10 @@ export function useScreenParams(params: URLSearchParams): ScreenParams {
|
||||
return parsed.data;
|
||||
}
|
||||
|
||||
export function recompileScreenParams(params: ScreenParams): string {
|
||||
const p = new URLSearchParams(
|
||||
export function searchParamsFromObject(obj: Object): URLSearchParams {
|
||||
return new URLSearchParams(
|
||||
Object.fromEntries(
|
||||
Object.entries(params).filter(([, v]) => v !== undefined),
|
||||
Object.entries(obj).filter(([, v]) => v !== undefined),
|
||||
) as Record<string, string>,
|
||||
).toString();
|
||||
|
||||
if (p.length > 0) {
|
||||
return "?" + p;
|
||||
}
|
||||
|
||||
return "";
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user