-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix the issue that prevents password-protected storefronts with an ampersand &
from logging in
#4657
Conversation
…persand `&` from logging in, and improve the password prompt message to disambiguate passwords
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/themes/urls.d.ts@@ -3,4 +3,5 @@ import { AdminSession } from '@shopify/cli-kit/node/session';
export declare function themePreviewUrl(theme: Theme, session: AdminSession): string;
export declare function themeEditorUrl(theme: Theme, session: AdminSession): string;
export declare function codeEditorUrl(theme: Theme, session: AdminSession): string;
-export declare function storeAdminUrl(session: AdminSession): string;
\ No newline at end of file
+export declare function storeAdminUrl(session: AdminSession): string;
+export declare function storePasswordPage(store: AdminSession['storeFqdn']): string;
\ No newline at end of file
packages/cli-kit/dist/private/node/ui/components/TextPrompt.d.ts@@ -2,7 +2,7 @@ import { InlineToken, TokenItem } from './TokenizedText.js';
import { AbortSignal } from '../../../../public/node/abort.js';
import { FunctionComponent } from 'react';
export interface TextPromptProps {
- message: string;
+ message: TokenItem;
onSubmit: (value: string) => void;
defaultValue?: string;
password?: boolean;
|
Coverage report
Test suite run success1904 tests passing in 866 suites. Report generated by 🧪jest coverage report action from 1fe7024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Thank you for the fix! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const response = await fetch(`${prependHttps(store)}/password`, { | ||
headers: { | ||
'cache-control': 'no-cache', | ||
'content-type': 'application/x-www-form-urlencoded', | ||
}, | ||
body: `form_type=storefront_password&utf8=%E2%9C%93&password=${password}`, | ||
body: params.toString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
const response = await fetch(`${prependHttps(store)}/password`, { | ||
headers: { | ||
'cache-control': 'no-cache', | ||
'content-type': 'application/x-www-form-urlencoded', | ||
}, | ||
body: `form_type=storefront_password&utf8=%E2%9C%93&password=${password}`, | ||
body: params.toString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch 😄
@Shopify/app-inner-loop Could you please approve this PR? |
WHY are these changes introduced?
Fixes #4597 and improves the password prompt message (used in
shopify theme console
/shopify theme dev
/shopify app dev
) to clarify which password the prompt refers to.WHAT is this pull request doing?
This PR fixes the issue by encoding passwords when checking if they are valid.
How to test your changes?
&
in the password.git cherry-pick 3f5c201cc7d2c23259ffcccd2e217a3ba3b94644
(this will clear your password, so you will be able to see the prompt even if your password is cached).shopify theme console
.Post-release steps
N/A
Measuring impact
How do we know this change was effective? Please choose one:
Checklist