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
0fde51fe
Commit
0fde51fe
authored
Nov 01, 2025
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the minor changes
parent
c0301948
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
page.tsx
src/app/(auth)/login/page.tsx
+4
-1
SeonProvider.tsx
src/app/SeonProvider.tsx
+14
-6
index.tsx
src/components/pages/auth/login/index.tsx
+3
-3
No files found.
src/app/(auth)/login/page.tsx
View file @
0fde51fe
import
{
SeonProvider
}
from
'@/app/SeonProvider'
import
LoginPage
from
'@/components/pages/auth/login'
import
React
from
'react'
export
default
function
Login
()
{
return
(
<
LoginPage
/>
<
SeonProvider
>
<
LoginPage
/>
</
SeonProvider
>
)
}
src/app/SeonProvider.tsx
View file @
0fde51fe
...
...
@@ -5,9 +5,14 @@ import seon from "@seontechnologies/seon-javascript-sdk";
type
SeonContextType
=
{
deviceId
?:
string
;
loading
:
boolean
;
sessionData
?:
any
;
// For storing additional session information if available
};
const
SeonContext
=
createContext
<
SeonContextType
>
({
deviceId
:
undefined
,
loading
:
true
});
const
SeonContext
=
createContext
<
SeonContextType
>
({
deviceId
:
undefined
,
loading
:
true
,
sessionData
:
undefined
});
export
const
useSeon
=
()
=>
useContext
(
SeonContext
);
...
...
@@ -16,7 +21,7 @@ export const SeonProvider: React.FC<{ children: React.ReactNode }> = ({ children
const
[
loading
,
setLoading
]
=
useState
(
true
);
useEffect
(()
=>
{
// Initialize the SDK on page load
seon
.
init
({
behavioralDataCollection
:
{
targets
:
'input[type="text"], .behavior'
,
...
...
@@ -24,9 +29,12 @@ export const SeonProvider: React.FC<{ children: React.ReactNode }> = ({ children
},
});
// Collect fingerprint
// Collect fingerprint
session
seon
.
getSession
()
.
then
((
session
:
any
)
=>
{
.
then
((
session
:
string
)
=>
{
// session holds the encrypted fingerprint as a base64 encoded string
// This is what you send to your backend for fraud detection
console
.
log
(
"Device fingerprint session:"
,
session
);
setDeviceId
(
session
);
setLoading
(
false
);
})
...
...
@@ -35,10 +43,10 @@ export const SeonProvider: React.FC<{ children: React.ReactNode }> = ({ children
setLoading
(
false
);
});
// Cleanup
behavioral tracking if needed
// Cleanup
: disable behavioral tracking when component unmounts
return
()
=>
{
seon
.
init
({
behavioralDataCollection
:
{
targets
:
""
},
behavioralDataCollection
:
{
targets
:
""
},
// disables tracking
});
};
},
[]);
...
...
src/components/pages/auth/login/index.tsx
View file @
0fde51fe
...
...
@@ -14,7 +14,7 @@ import { showToast, ToastVariant } from '@/slice/toastSlice';
import
{
clearTokens
,
setTokens
}
from
'@/slice/authSlice'
;
import
PasswordField
from
'@/components/molecules/PasswordField'
;
import
{
ArrowLeft
}
from
'@wandersonalwes/iconsax-react'
;
//
import { useSeon } from '@/app/SeonProvider';
import
{
useSeon
}
from
'@/app/SeonProvider'
;
const
validationSchema
=
Yup
.
object
().
shape
({
emailAddress
:
Yup
.
string
()
...
...
@@ -39,7 +39,7 @@ export default function LoginPage() {
const
router
=
useRouter
();
const
dispatch
=
useAppDispatch
();
const
[
loginUser
,
{
isLoading
}]
=
useLoginMutation
();
//
const { deviceId, loading } = useSeon();
const
{
deviceId
,
loading
}
=
useSeon
();
const
{
handleSubmit
,
handleBlur
,
handleChange
,
errors
,
dirty
,
values
,
touched
}
=
useFormik
(
{
initialValues
,
...
...
@@ -49,7 +49,7 @@ export default function LoginPage() {
const
response
=
await
loginUser
({
email
:
values
.
emailAddress
,
password
:
values
.
password
,
// device_id:
deviceId
device_id
:
deviceId
}).
unwrap
();
dispatch
(
...
...
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