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
3d924a35
Commit
3d924a35
authored
Dec 18, 2025
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the device_id at the auth route
parent
fdb4bb00
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
12 deletions
+18
-12
page.tsx
src/app/(auth)/verify-email/page.tsx
+6
-4
index.tsx
src/components/pages/auth/register/index.tsx
+4
-1
authApi.ts
src/services/authApi.ts
+5
-5
baseQuery.ts
src/services/baseQuery.ts
+1
-2
auth.ts
src/types/auth.ts
+2
-0
No files found.
src/app/(auth)/verify-email/page.tsx
View file @
3d924a35
"use client"
;
"use client"
;
import
{
useSeon
}
from
'@/app/SeonProvider'
;
import
GlassWrapper
from
'@/components/molecules/GlassWrapper'
;
import
GlassWrapper
from
'@/components/molecules/GlassWrapper'
;
import
{
useAppDispatch
}
from
'@/hooks/hook'
;
import
{
useAppDispatch
}
from
'@/hooks/hook'
;
import
{
PATH
}
from
'@/routes/PATH'
;
import
{
PATH
}
from
'@/routes/PATH'
;
import
{
useSendVerificationLinkAgainMutation
,
useVerifyEmailMutation
}
from
'@/services/authApi'
;
import
{
useSendVerificationLinkAgainMutation
,
useVerifyEmailMutation
}
from
'@/services/authApi'
;
import
{
showToast
,
ToastVariant
}
from
'@/slice/toastSlice'
;
import
{
showToast
,
ToastVariant
}
from
'@/slice/toastSlice'
;
import
{
B
ox
,
B
utton
}
from
'@mui/material'
;
import
{
Button
}
from
'@mui/material'
;
import
Image
from
'next/image'
;
import
Image
from
'next/image'
;
import
Link
from
'next/link'
;
import
{
useRouter
,
useSearchParams
}
from
'next/navigation'
;
import
{
useRouter
,
useSearchParams
}
from
'next/navigation'
;
import
React
,
{
Suspense
}
from
'react'
;
import
{
Suspense
}
from
'react'
;
function
VerifyEmailContent
()
{
function
VerifyEmailContent
()
{
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -21,6 +21,8 @@ function VerifyEmailContent() {
...
@@ -21,6 +21,8 @@ function VerifyEmailContent() {
const
[
verifyEmail
,
{
isLoading
}]
=
useVerifyEmailMutation
();
const
[
verifyEmail
,
{
isLoading
}]
=
useVerifyEmailMutation
();
const
dispatch
=
useAppDispatch
();
const
dispatch
=
useAppDispatch
();
const
{
deviceId
,
loading
}
=
useSeon
();
const
handleLinkResend
=
async
()
=>
{
const
handleLinkResend
=
async
()
=>
{
try
{
try
{
const
response
=
await
sendEmailVerificationAgain
({
email
:
email
||
""
}).
unwrap
();
const
response
=
await
sendEmailVerificationAgain
({
email
:
email
||
""
}).
unwrap
();
...
@@ -44,7 +46,7 @@ function VerifyEmailContent() {
...
@@ -44,7 +46,7 @@ function VerifyEmailContent() {
const
handleEmailVerification
=
async
()
=>
{
const
handleEmailVerification
=
async
()
=>
{
try
{
try
{
const
response
=
await
verifyEmail
({
id
:
id
||
""
,
hash
:
hash
||
""
}).
unwrap
();
const
response
=
await
verifyEmail
({
id
:
id
||
""
,
hash
:
hash
||
""
,
device_id
:
deviceId
||
""
}).
unwrap
();
dispatch
(
dispatch
(
showToast
({
showToast
({
message
:
response
?.
message
||
"Account verified successfully"
,
message
:
response
?.
message
||
"Account verified successfully"
,
...
...
src/components/pages/auth/register/index.tsx
View file @
3d924a35
'use client'
;
'use client'
;
import
{
useSeon
}
from
'@/app/SeonProvider'
;
import
PasswordField
from
'@/components/molecules/PasswordField'
;
import
PasswordField
from
'@/components/molecules/PasswordField'
;
import
{
useAppDispatch
}
from
'@/hooks/hook'
;
import
{
useAppDispatch
}
from
'@/hooks/hook'
;
import
{
PATH
}
from
'@/routes/PATH'
;
import
{
PATH
}
from
'@/routes/PATH'
;
...
@@ -117,6 +118,7 @@ export default function RegisterPage() {
...
@@ -117,6 +118,7 @@ export default function RegisterPage() {
pob
:
''
,
pob
:
''
,
agree
:
true
agree
:
true
}
}
const
{
deviceId
,
loading
}
=
useSeon
();
const
{
handleSubmit
,
handleBlur
,
handleChange
,
errors
,
dirty
,
values
,
touched
,
setFieldValue
,
setFieldTouched
}
=
useFormik
(
const
{
handleSubmit
,
handleBlur
,
handleChange
,
errors
,
dirty
,
values
,
touched
,
setFieldValue
,
setFieldTouched
}
=
useFormik
(
{
{
initialValues
,
initialValues
,
...
@@ -137,7 +139,8 @@ export default function RegisterPage() {
...
@@ -137,7 +139,8 @@ export default function RegisterPage() {
dob
:
formattedDob
,
dob
:
formattedDob
,
city
:
values
.
city
,
city
:
values
.
city
,
pob
:
values
.
pob
,
pob
:
values
.
pob
,
agree
:
values
.
agree
agree
:
values
.
agree
,
device_id
:
deviceId
}).
unwrap
();
}).
unwrap
();
dispatch
(
dispatch
(
...
...
src/services/authApi.ts
View file @
3d924a35
...
@@ -11,14 +11,14 @@ export const authApi = createApi({
...
@@ -11,14 +11,14 @@ export const authApi = createApi({
query
:
({
email
,
query
:
({
email
,
username
,
username
,
password
,
password
,
password_confirmation
,
first_name
,
middle_name
,
last_name
,
phone
,
photoid_number
,
dob
,
city
,
pob
,
agree
})
=>
({
password_confirmation
,
first_name
,
middle_name
,
last_name
,
phone
,
photoid_number
,
dob
,
city
,
pob
,
agree
,
device_id
})
=>
({
url
:
`/api/auth/register`
,
url
:
`/api/auth/register`
,
method
:
"POST"
,
method
:
"POST"
,
body
:
{
body
:
{
email
,
email
,
username
,
username
,
password
,
password
,
password_confirmation
,
first_name
,
middle_name
,
last_name
,
phone
,
photoid_number
,
dob
,
city
,
pob
,
agree
password_confirmation
,
first_name
,
middle_name
,
last_name
,
phone
,
photoid_number
,
dob
,
city
,
pob
,
agree
,
device_id
},
},
}),
}),
...
@@ -37,11 +37,11 @@ export const authApi = createApi({
...
@@ -37,11 +37,11 @@ export const authApi = createApi({
body
:
{
email
},
body
:
{
email
},
})
})
}),
}),
verifyEmail
:
builder
.
mutation
<
GlobalResponse
,
{
id
:
string
;
hash
:
string
}
>
({
verifyEmail
:
builder
.
mutation
<
GlobalResponse
,
{
id
:
string
;
hash
:
string
,
device_id
:
string
}
>
({
query
:
({
id
,
hash
})
=>
({
query
:
({
id
,
hash
,
device_id
})
=>
({
url
:
"/api/auth/verify-email"
,
url
:
"/api/auth/verify-email"
,
method
:
"POST"
,
method
:
"POST"
,
body
:
{
id
,
hash
},
body
:
{
id
,
hash
,
device_id
},
})
})
}),
}),
forgotPassword
:
builder
.
mutation
<
GlobalResponse
,
{
email
:
string
}
>
({
forgotPassword
:
builder
.
mutation
<
GlobalResponse
,
{
email
:
string
}
>
({
...
...
src/services/baseQuery.ts
View file @
3d924a35
...
@@ -18,9 +18,8 @@ export const baseQuery = fetchBaseQuery({
...
@@ -18,9 +18,8 @@ export const baseQuery = fetchBaseQuery({
headers
.
set
(
"Accept"
,
"application/json"
);
headers
.
set
(
"Accept"
,
"application/json"
);
console
.
log
(
"deviceId"
,
globalDeviceId
)
if
(
globalDeviceId
)
{
if
(
globalDeviceId
)
{
headers
.
set
(
"
Device_i
d"
,
globalDeviceId
);
headers
.
set
(
"
X-Device-I
d"
,
globalDeviceId
);
}
}
if
(
token
)
{
if
(
token
)
{
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
...
...
src/types/auth.ts
View file @
3d924a35
...
@@ -40,4 +40,5 @@ export interface RegisterProps extends LoginProps {
...
@@ -40,4 +40,5 @@ export interface RegisterProps extends LoginProps {
city
:
string
;
city
:
string
;
pob
:
string
;
pob
:
string
;
agree
:
boolean
;
agree
:
boolean
;
device_id
?:
string
;
}
}
\ No newline at end of file
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