-
-
Notifications
You must be signed in to change notification settings - Fork 4
Release v1.0.1 #333
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
Merged
Merged
Release v1.0.1 #333
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
96a7ebf
feat(mobile): improve dashboard, leaderboard & AI helper UX for touch…
TiZorii 2002f6e
Added touchcancel listener
TiZorii 7f20611
Merge pull request #316 from DevLoversTeam/feat/dashboard-leaderboard…
ViktorSvertoka c883084
(SP: 2) [Frontend] Quiz results dashboard, review cache fix, UX impro…
LesiaUKR d221d5c
(SP: 3) [Backend] add internal janitor (jobs 1-4), claim/lease + runb…
liudmylasovetovs 1165c15
(SP: 2) [Frontend] Redesign Home Hero & Add Features Section (#319)
yevheniidatsenko dcd8c0f
(SP: 2) [Frontend] Quiz UX improvements: violations counter, breadcru…
LesiaUKR 03b3871
Header UX polish, quiz highlight fix, Blog button styling, shop i18n …
TiZorii bd66f7d
(SP: 1) [Frontend] Q&A: Next.js tab states + faster loader start (#324)
ViktorSvertoka 058b769
(SP: 1) [Frontend] Align quiz result messages with status badges, fix…
LesiaUKR f56413e
chore(release): v1.0.0
ViktorSvertoka a014f16
Merge remote-tracking branch 'origin/main' into develop
ViktorSvertoka b53c189
feat(jpg): add images for shop
ViktorSvertoka 2b028af
(SP: 3) [Shop][Monobank] Janitor map + internal janitor endpoint stub…
liudmylasovetovs 1134589
(SP:2) [Frontend] Fix duplicated Q&A items after content updates (#330)
ViktorSvertoka 13d5f77
(SP: 1) [Frontend] Integrate online users counter popup and fix heade…
YNazymko12 ddc16bc
Bug/fix qa (#332)
ViktorSvertoka 97f120a
chore(release): v1.0.1
ViktorSvertoka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,43 @@ | ||
| import type { Metadata } from 'next'; | ||
|
|
||
| import { isMonobankEnabled } from '@/lib/env/monobank'; | ||
|
|
||
| import CartPageClient from './CartPageClient'; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: 'Cart | DevLovers', | ||
| description: 'Review items in your cart and proceed to checkout.', | ||
| }; | ||
|
|
||
| function isFlagEnabled(value: string | undefined): boolean { | ||
| return (value ?? '').trim() === 'true'; | ||
| } | ||
|
|
||
| function resolveStripeCheckoutEnabled(): boolean { | ||
| const paymentsEnabled = isFlagEnabled(process.env.PAYMENTS_ENABLED); | ||
| const stripeFlag = (process.env.STRIPE_PAYMENTS_ENABLED ?? '').trim(); | ||
|
|
||
| return ( | ||
| paymentsEnabled && (stripeFlag.length > 0 ? stripeFlag === 'true' : true) | ||
| ); | ||
| } | ||
|
|
||
| function resolveMonobankCheckoutEnabled(): boolean { | ||
| const paymentsEnabled = isFlagEnabled(process.env.PAYMENTS_ENABLED); | ||
| if (!paymentsEnabled) return false; | ||
|
|
||
| try { | ||
| return isMonobankEnabled(); | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| export default function CartPage() { | ||
| return <CartPageClient />; | ||
| return ( | ||
| <CartPageClient | ||
| stripeEnabled={resolveStripeCheckoutEnabled()} | ||
| monobankEnabled={resolveMonobankCheckoutEnabled()} | ||
| /> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Validate
monobankPageUrlbefore redirecting.window.location.assign(monobankPageUrl)on line 206 navigates to a URL returned by the server. If the API were ever compromised or returned ajavascript:scheme, this could be an open-redirect / XSS vector. Consider validating that the URL starts withhttps://before assigning:🛡️ Proposed validation
if (paymentProvider === 'monobank' && monobankPageUrl) { + try { + const url = new URL(monobankPageUrl); + if (url.protocol !== 'https:') { + setCheckoutError(t('checkout.errors.unexpectedResponse')); + return; + } + } catch { + setCheckoutError(t('checkout.errors.unexpectedResponse')); + return; + } window.location.assign(monobankPageUrl); return; }🤖 Prompt for AI Agents