Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: more lenient callback uri check #1324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/keychain/src/components/session.tsx
Original file line number Diff line number Diff line change
@@ -189,8 +189,8 @@ export function Session() {
function sanitizeCallbackUrl(url: string): URL | undefined {
try {
const parsed = new URL(url);
const allowedHostnames = ["localhost"];
const allowedPaths = ["/callback"];
const allowedHostnames = ["localhost", "127.0.0.1"];
const allowedPaths = ["/", "/callback"];

if (
!allowedHostnames.includes(parsed.hostname) ||

Unchanged files with check annotations Beta

setError(e as unknown as Error);
setIsConnecting(false);
}
}, [controller, duration, policies, maxFee, onConnect]);

Check warning on line 76 in packages/keychain/src/components/connect/CreateSession.tsx

GitHub Actions / ts-lint

React Hook useCallback has a missing dependency: 'expiresAt'. Either include it or remove the dependency array
const onSkipSession = useCallback(async () => {
if (!controller || !policies) return;
loginMode,
});
const handleFormSubmit = () => {

Check warning on line 181 in packages/keychain/src/components/connect/create/CreateController.tsx

GitHub Actions / ts-lint

The 'handleFormSubmit' function makes the dependencies of useEffect Hook (at line 201) change on every render. To fix this, wrap the definition of 'handleFormSubmit' in its own useCallback() Hook
if (!usernameField.value) {
return;
}