Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sweepstake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arjun Jhukal
sweepstake
Commits
b0a9a158
Commit
b0a9a158
authored
Apr 03, 2026
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor change
parent
3294a2f4
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
28 additions
and
41 deletions
+28
-41
page.tsx
...d)/(user)/(outsideAuth)/buy-coins/[slug]/success/page.tsx
+0
-2
AuthHydrator.tsx
src/components/Hydrators/AuthHydrator.tsx
+0
-1
PaymentModal.tsx
src/components/molecules/PaymentModal.tsx
+0
-1
index.tsx
src/components/organism/UpdatePassword/index.tsx
+1
-4
index.tsx
src/components/pages/auth/login/index.tsx
+0
-1
index.tsx
src/components/pages/auth/register/index.tsx
+0
-1
index.tsx
.../dashboard/adminDashboard/players/addPlayerForm/index.tsx
+1
-1
FortPay.tsx
...Dashboard/buyCoins/buyCoinSinlgeGame/checkout/FortPay.tsx
+0
-2
index.tsx
...mponents/pages/dashboard/userDashboard/buyCoins/index.tsx
+0
-2
CredentialsCard.tsx
...shboard/userDashboard/gameCredentials/CredentialsCard.tsx
+0
-4
ResetPasswordDialog.tsx
...ard/userDashboard/gameCredentials/ResetPasswordDialog.tsx
+0
-1
index.tsx
...ponents/pages/dashboard/userDashboard/withdrawl/index.tsx
+0
-2
ProtectedLink.tsx
src/routes/ProtectedLink.tsx
+0
-1
baseQuery.ts
src/services/baseQuery.ts
+25
-9
index.tsx
src/theme/index.tsx
+1
-2
authSession.ts
src/utils/authSession.ts
+0
-7
No files found.
src/app/(dashboard)/(user)/(outsideAuth)/buy-coins/[slug]/success/page.tsx
View file @
b0a9a158
...
...
@@ -22,13 +22,11 @@ export default function PaymentSuccess() {
useEffect
(()
=>
{
const
hydrateAuthOnSuccess
=
async
()
=>
{
try
{
console
.
log
(
'[PaymentSuccess] Starting auth hydration...'
);
// Try to restore auth from backup
const
result
=
restoreAuthFromCookies
();
if
(
result
.
success
&&
result
.
data
)
{
console
.
log
(
`[PaymentSuccess] Auth restored from
${
result
.
source
}
`
);
// Update Redux store
dispatch
(
setTokens
({
...
...
src/components/Hydrators/AuthHydrator.tsx
View file @
b0a9a158
...
...
@@ -23,7 +23,6 @@ export default function AuthHydrator() {
const
result
=
restoreAuthFromCookies
();
if
(
result
.
success
&&
result
.
data
)
{
console
.
log
(
`[AuthHydrator] Restored auth from
${
result
.
source
}
`
);
// Dispatch to Redux to update app state
dispatch
(
setTokens
({
...
...
src/components/molecules/PaymentModal.tsx
View file @
b0a9a158
...
...
@@ -138,7 +138,6 @@ export default function PaymentModal({
});
if
(
found
)
{
console
.
log
(
'[PaymentModal] Detected success redirect URL:'
,
currentUrl
);
setHasDetectedSuccess
(
true
);
setIsLoading
(
false
);
onSuccess
?.();
...
...
src/components/organism/UpdatePassword/index.tsx
View file @
b0a9a158
...
...
@@ -15,9 +15,7 @@ export default function UpdatePassword() {
const
{
open
,
provider
}
=
useSelector
((
state
:
RootState
)
=>
state
?.
updatePasswordSlice
);
const
[
updateNewPassword
,
{
isLoading
}]
=
useUpdateUserGamePasswordMutation
();
console
.
log
({
open
,
provider
})
const
formik
=
useFormik
({
initialValues
:
{
password
:
""
},
validationSchema
:
Yup
.
object
({
...
...
@@ -28,7 +26,6 @@ export default function UpdatePassword() {
onSubmit
:
async
(
values
)
=>
{
try
{
console
.
log
(
"New password:"
,
values
.
password
);
const
response
=
await
updateNewPassword
({
password
:
values
.
password
,
provider
:
provider
||
""
...
...
src/components/pages/auth/login/index.tsx
View file @
b0a9a158
...
...
@@ -77,7 +77,6 @@ export default function LoginPage() {
secure
:
process
.
env
.
NODE_ENV
===
'production'
,
sameSite
:
'Strict'
,
});
console
.
log
(
"Login Response:"
,
response
?.
data
?.
user
?.
role
.
toLowerCase
()
===
"user"
);
router
.
replace
(
response
?.
data
?.
user
?.
role
?.
toLowerCase
()
===
"user"
?
"/credentials"
:
"/"
);
}
catch
(
e
:
any
)
{
...
...
src/components/pages/auth/register/index.tsx
View file @
b0a9a158
...
...
@@ -168,7 +168,6 @@ export default function RegisterPage() {
autoTime
:
true
,
}),
);
console
.
log
(
"Register response:"
,
response
?.
data
?.
redirection_url
);
if
(
response
?.
data
?.
redirection_url
)
{
window
.
open
(
response
?.
data
?.
redirection_url
,
"_blank"
);
setAcuityUrl
(
response
.
data
.
redirection_url
);
...
...
src/components/pages/dashboard/adminDashboard/players/addPlayerForm/index.tsx
View file @
b0a9a158
...
...
@@ -27,7 +27,7 @@ export const PlayerValidationSchema = (isEdit: boolean) => Yup.object().shape({
.
matches
(
/^
\+?\d{7,15}
$/
,
"Invalid phone number"
)
.
required
(
"Phone is required"
),
password
:
isEdit
?
Yup
.
string
().
nullable
()
// not required in edit mode
?
Yup
.
string
().
nullable
()
:
Yup
.
string
().
min
(
6
,
"Password must be at least 6 characters"
).
required
(
"Password is required"
),
password_confirmation
:
isEdit
?
Yup
.
string
().
nullable
()
:
Yup
.
string
().
when
(
"password"
,
{
is
:
(
val
:
string
)
=>
!!
val
,
...
...
src/components/pages/dashboard/userDashboard/buyCoins/buyCoinSinlgeGame/checkout/FortPay.tsx
View file @
b0a9a158
...
...
@@ -97,7 +97,6 @@ export default function PaymentForm({ id, amount, type }: DepositProps & { type:
},
callback
:
async
(
response
:
any
)
=>
{
try
{
console
.
log
(
"token value is"
,
response
);
await
payViaFortPay
({
id
,
amount
,
...
...
@@ -111,7 +110,6 @@ export default function PaymentForm({ id, amount, type }: DepositProps & { type:
// Backup auth before redirecting to success page
backupAuthToCookies
();
console
.
log
(
'[FortPay] Auth backed up before redirect'
);
router
.
push
(
`/buy-coins/
${
id
}
/success`
);
}
catch
(
e
:
any
)
{
...
...
src/components/pages/dashboard/userDashboard/buyCoins/index.tsx
View file @
b0a9a158
...
...
@@ -19,7 +19,6 @@ export default function BuyCoinGameListPage({
const
gameInfo
=
coins
?.
data
?.
game_information
||
{}
const
dispatch
=
useAppDispatch
();
console
.
log
(
"coins"
,
coins
);
return
(
<
section
className=
"buy__coin__root"
>
<
div
className=
"section__title mb-4 lg:mb-8 max-w-[520px]"
>
...
...
@@ -33,7 +32,6 @@ export default function BuyCoinGameListPage({
{
games
.
data
?.
data
.
map
((
game
)
=>
{
const
info
=
gameInfo
[
game
.
provider
.
toLowerCase
()]
||
{
balance
:
0
,
type
:
'sc'
}
const
CoinIcon
=
info
.
type
===
'gc'
?
GoldCoinIcon
:
SilverCoinIcon
console
.
log
(
info
.
has_changed_password
)
return
(
<
div
key=
{
game
.
id
}
className=
{
`col-span-1 ${info.type === 'gc' ? "hidden" : ""}`
}
>
...
...
src/components/pages/dashboard/userDashboard/gameCredentials/CredentialsCard.tsx
View file @
b0a9a158
...
...
@@ -43,7 +43,6 @@ export default function CredentialsCard({ cred }: { cred: CredentialsProps }) {
const
dispatch
=
useAppDispatch
();
const
newBalance
=
useAppSelector
((
state
)
=>
state
.
userBalanceSlice
);
console
.
log
(
"newBalance in cred card:"
,
newBalance
);
const
providerBalance
:
any
=
newBalance
.
providerAndBalance
?.
find
((
item
:
any
)
=>
item
?.
provider
===
cred
.
name
);
return
(
...
...
@@ -85,13 +84,11 @@ export default function CredentialsCard({ cred }: { cred: CredentialsProps }) {
icon=
{
true
}
onClick=
{
()
=>
{
if
(
balance
?.
has_changed_password
)
{
console
.
log
(
"password changes"
);
dispatch
(
openPasswordDialog
({
provider
:
cred
?.
name
,
}));
}
else
{
console
.
log
(
"password not changes"
);
refetch
();
}
}
}
...
...
@@ -139,7 +136,6 @@ export default function CredentialsCard({ cred }: { cred: CredentialsProps }) {
onClick=
{
(
e
)
=>
{
if
(
balance
?.
has_changed_password
)
{
e
.
preventDefault
();
console
.
log
(
"password changes"
);
dispatch
(
openPasswordDialog
({
provider
:
cred
?.
name
,
}));
...
...
src/components/pages/dashboard/userDashboard/gameCredentials/ResetPasswordDialog.tsx
View file @
b0a9a158
...
...
@@ -38,7 +38,6 @@ export default function ResetPasswordDialog({
onClose
:
()
=>
void
;
name
:
string
;
})
{
console
.
log
(
"ResetPasswordDialog name:"
,
name
);
const
dispatch
=
useAppDispatch
();
const
[
resetGamePassord
,
{
isLoading
}]
=
useChangeUserGamePasswordMutation
();
...
...
src/components/pages/dashboard/userDashboard/withdrawl/index.tsx
View file @
b0a9a158
...
...
@@ -131,7 +131,6 @@ export default function WithdrawlPage({
})
);
}
catch
(
e
:
any
)
{
console
.
log
(
"Withdrawal Error:"
,
e
);
dispatch
(
showToast
({
message
:
e
?.
data
?.
message
||
"Something went wrong"
,
...
...
@@ -179,7 +178,6 @@ export default function WithdrawlPage({
}
};
console
.
log
(
"Formik Errors:"
,
formik
.
values
.
withdrawl_amounts
);
return
(
<
section
className=
"withdrawl__root"
>
<
div
className=
"section__title mb-4 lg:mb-8 max-w-[560px]"
>
...
...
src/routes/ProtectedLink.tsx
View file @
b0a9a158
...
...
@@ -21,7 +21,6 @@ export default function ProtectedLink({ href, className, children, target, rel,
const
{
data
}
=
useGetGamesPasswordStatusQuery
({
provider
:
provider
||
""
},
{
skip
:
!
provider
});
console
.
log
(
"user data"
,
{
data
,
provider
});
const
handleClick
=
(
e
:
React
.
MouseEvent
)
=>
{
if
(
!
user
)
{
...
...
src/services/baseQuery.ts
View file @
b0a9a158
...
...
@@ -3,28 +3,43 @@ import { RootState } from "@/hooks/store";
import
{
fetchBaseQuery
}
from
"@reduxjs/toolkit/query/react"
;
let
globalDeviceId
:
string
|
undefined
=
undefined
;
let
globalDeviceFingerprint
:
string
|
undefined
=
undefined
;
let
resolveFingerprint
:
(()
=>
void
)
|
undefined
;
const
fingerprintReady
=
new
Promise
<
void
>
((
resolve
)
=>
{
resolveFingerprint
=
resolve
;
});
// Safety timeout — never block forever
const
fingerprintTimeout
=
setTimeout
(()
=>
resolveFingerprint
?.(),
4000
);
export
const
setGlobalDeviceId
=
(
id
?:
string
)
=>
{
globalDeviceId
=
id
;
};
export
const
baseQuery
=
fetchBaseQuery
({
baseUrl
:
(
process
.
env
.
NEXT_PUBLIC_FRONTEND_URL
||
""
)
+
"/api/backend"
,
export
const
setGlobalDeviceFingerprint
=
(
fingerprint
?:
string
)
=>
{
globalDeviceFingerprint
=
fingerprint
;
clearTimeout
(
fingerprintTimeout
);
resolveFingerprint
?.();
};
const
base
=
fetchBaseQuery
({
baseUrl
:
(
process
.
env
.
NEXT_PUBLIC_FRONTEND_URL
||
""
)
+
"/api/backend"
,
credentials
:
"include"
,
prepareHeaders
:
(
headers
,
{
getState
})
=>
{
const
token
=
(
getState
()
as
RootState
).
auth
.
access_token
;
headers
.
set
(
"Accept"
,
"application/json"
);
if
(
globalDeviceId
)
{
headers
.
set
(
"X-Device-Id"
,
globalDeviceId
);
}
if
(
token
)
{
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
}
if
(
globalDeviceId
)
headers
.
set
(
"X-Device-Id"
,
globalDeviceId
);
if
(
globalDeviceFingerprint
)
headers
.
set
(
"X-Device-Fingerprint"
,
globalDeviceFingerprint
);
if
(
token
)
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
return
headers
;
},
});
export
const
baseQuery
:
ReturnType
<
typeof
fetchBaseQuery
>
=
async
(
queryArg
,
api
,
extraOptions
)
=>
{
await
fingerprintReady
;
return
base
(
queryArg
,
api
,
extraOptions
);
};
\ No newline at end of file
src/theme/index.tsx
View file @
b0a9a158
...
...
@@ -11,7 +11,7 @@ import Palette from './palette';
export
default
function
ThemeCustomization
({
children
}:
{
children
:
React
.
ReactNode
})
{
const
[
theme
,
setTheme
]
=
React
.
useState
(
ThemeMode
.
DARK
);
const
[
_
theme
,
setTheme
]
=
React
.
useState
(
ThemeMode
.
DARK
);
const
user
=
useAppSelector
((
state
)
=>
state
.
auth
.
user
);
const
globalStyles
=
{
...
...
@@ -33,7 +33,6 @@ export default function ThemeCustomization({ children }: { children: React.React
},
[
user
]);
console
.
log
(
theme
)
return
(
<
StyledEngineProvider
injectFirst
>
<
NextAppDirEmotionCacheProvider
options=
{
{
key
:
'mui'
}
}
>
...
...
src/utils/authSession.ts
View file @
b0a9a158
...
...
@@ -64,7 +64,6 @@ export function backupAuthToCookies(): void {
});
sessionStorage
.
setItem
(
TIMESTAMP_KEY
,
timestamp
.
toString
());
console
.
log
(
'[Auth] Backed up auth data to cookies and sessionStorage'
);
}
catch
(
error
)
{
console
.
error
(
'[Auth] Failed to backup auth data:'
,
error
);
}
...
...
@@ -88,7 +87,6 @@ export function restoreAuthFromCookies(): AuthRestorationResult {
const
sessionUser
=
sessionStorage
.
getItem
(
`
${
SESSION_BACKUP_PREFIX
}
user`
);
if
(
sessionAccessToken
&&
sessionUser
)
{
console
.
log
(
'[Auth] Restoring from sessionStorage'
);
const
userData
=
JSON
.
parse
(
sessionUser
);
const
authData
:
AuthData
=
{
access_token
:
sessionAccessToken
,
...
...
@@ -108,7 +106,6 @@ export function restoreAuthFromCookies(): AuthRestorationResult {
// Try cookies (cross-tab scenario from payment provider)
const
wasRedirected
=
Cookies
.
get
(
`
${
BACKUP_PREFIX
}
redirected`
);
if
(
!
wasRedirected
)
{
console
.
log
(
'[Auth] No redirect marker found'
);
return
{
success
:
false
,
source
:
'none'
,
data
:
null
};
}
...
...
@@ -117,7 +114,6 @@ export function restoreAuthFromCookies(): AuthRestorationResult {
const
cookieUser
=
Cookies
.
get
(
`
${
BACKUP_PREFIX
}
user`
);
if
(
cookieAccessToken
&&
cookieUser
)
{
console
.
log
(
'[Auth] Restoring from cookies'
);
const
userData
=
JSON
.
parse
(
cookieUser
);
const
authData
:
AuthData
=
{
access_token
:
cookieAccessToken
,
...
...
@@ -138,7 +134,6 @@ export function restoreAuthFromCookies(): AuthRestorationResult {
return
{
success
:
true
,
source
:
'cookies'
,
data
:
authData
};
}
console
.
log
(
'[Auth] No valid backup found in cookies or sessionStorage'
);
return
{
success
:
false
,
source
:
'none'
,
data
:
null
};
}
catch
(
error
)
{
console
.
error
(
'[Auth] Failed to restore auth data:'
,
error
);
...
...
@@ -156,7 +151,6 @@ function cleanupAuthCookies(): void {
Cookies
.
remove
(
`
${
BACKUP_PREFIX
}${
key
}
`
);
});
Cookies
.
remove
(
`
${
BACKUP_PREFIX
}
redirected`
);
console
.
log
(
'[Auth] Cleaned up backup cookies'
);
}
/**
...
...
@@ -169,7 +163,6 @@ function cleanupAuthSessionStorage(): void {
sessionStorage
.
removeItem
(
`
${
SESSION_BACKUP_PREFIX
}${
key
}
`
);
});
sessionStorage
.
removeItem
(
TIMESTAMP_KEY
);
console
.
log
(
'[Auth] Cleaned up sessionStorage backup'
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment