ui-soxo-bootstrap-core 2.4.25-dev.11 → 2.4.25-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,25 +16,6 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
16
16
|
* @returns {(seconds: number) => void} API.start - Start timer with seconds.
|
|
17
17
|
* @returns {(expirytime: string) => void} API.startFromExpiry - Start timer using expiry string (e.g. "2025-09-04T12:13:09.000Z").
|
|
18
18
|
*
|
|
19
|
-
* @example
|
|
20
|
-
* const { remaining, expired, formatted, start, startFromExpiry } = useOtpTimer();
|
|
21
|
-
*
|
|
22
|
-
* // Start with 30 seconds
|
|
23
|
-
* useEffect(() => {
|
|
24
|
-
* start(30);
|
|
25
|
-
* }, []);
|
|
26
|
-
*
|
|
27
|
-
* // OR start from backend expiry timestamp
|
|
28
|
-
* useEffect(() => {
|
|
29
|
-
* startFromExpiry("2025-09-04T12:13:09.000Z");
|
|
30
|
-
* }, []);
|
|
31
|
-
*
|
|
32
|
-
* return (
|
|
33
|
-
* <div>
|
|
34
|
-
* <p>Time left: {formatted}</p>
|
|
35
|
-
* {expired && <p>OTP expired!</p>}
|
|
36
|
-
* </div>
|
|
37
|
-
* );
|
|
38
19
|
*/
|
|
39
20
|
|
|
40
21
|
// helper to format time
|
|
@@ -121,9 +121,11 @@ function LoginPhone({ history, appSettings }) {
|
|
|
121
121
|
.then((result) => {
|
|
122
122
|
setLoading(false);
|
|
123
123
|
|
|
124
|
-
const { user, access_token, refresh_token } = result;
|
|
124
|
+
const { user, access_token, refresh_token, insider_token } = result;
|
|
125
125
|
if (access_token) localStorage.access_token = access_token;
|
|
126
126
|
|
|
127
|
+
if (insider_token) localStorage.insider_token = insider_token;
|
|
128
|
+
|
|
127
129
|
if (result.success) {
|
|
128
130
|
//two_factor_authentication variable is present then proceed Two factor authentication
|
|
129
131
|
if (result.data && result.data.two_factor_authentication) {
|
|
@@ -516,28 +518,28 @@ function LoginPhone({ history, appSettings }) {
|
|
|
516
518
|
return user.username;
|
|
517
519
|
};
|
|
518
520
|
|
|
519
|
-
const { globalCustomerHeader = () => {} } = appSettings;
|
|
521
|
+
const { globalCustomerHeader = () => { } } = appSettings;
|
|
520
522
|
|
|
521
523
|
const themeName = process.env.REACT_APP_THEME; // e.g., 'purple'
|
|
522
524
|
const isPurple = themeName === 'purple';
|
|
523
525
|
|
|
524
526
|
const sectionStyle = isPurple
|
|
525
527
|
? {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
528
|
+
width: '100%',
|
|
529
|
+
height: '100vh',
|
|
530
|
+
backgroundImage: `${state.theme.colors.loginPageBackground}`,
|
|
531
|
+
backgroundPosition: 'center bottom, center',
|
|
532
|
+
backgroundRepeat: 'no-repeat, no-repeat',
|
|
533
|
+
backgroundSize: 'cover, cover',
|
|
534
|
+
}
|
|
533
535
|
: {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
536
|
+
width: '100%',
|
|
537
|
+
height: '100vh',
|
|
538
|
+
backgroundImage: `url(${backgroundImage}), ${state.theme.colors.loginPageBackground}`,
|
|
539
|
+
backgroundPosition: 'center bottom, center',
|
|
540
|
+
backgroundRepeat: 'no-repeat, no-repeat',
|
|
541
|
+
backgroundSize: 'cover, cover',
|
|
542
|
+
};
|
|
541
543
|
|
|
542
544
|
return (
|
|
543
545
|
<section className="full-page" style={sectionStyle}>
|
|
@@ -610,10 +612,10 @@ function LoginPhone({ history, appSettings }) {
|
|
|
610
612
|
<Text type="primary">Select Preferred OTP Verification Method</Text>
|
|
611
613
|
<div className="otp-method-group">
|
|
612
614
|
<Radio checked={communicationMode === 'email'} onChange={() => setCommunicationMode('email')}>
|
|
613
|
-
Email <MailOutlined style={{ marginLeft: 6 }} />
|
|
615
|
+
Email <MailOutlined className="otp-icon" style={{ marginLeft: 6 }} />
|
|
614
616
|
</Radio>
|
|
615
617
|
<Radio checked={communicationMode === 'mobile'} onChange={() => setCommunicationMode('mobile')}>
|
|
616
|
-
SMS <MessageOutlined style={{ marginLeft: 6 }} />
|
|
618
|
+
SMS <MessageOutlined className="otp-icon" style={{ marginLeft: 6 }} />
|
|
617
619
|
</Radio>
|
|
618
620
|
</div>
|
|
619
621
|
{modeError && <p className="otp-mode-error">Please select a communication mode.</p>}
|
|
@@ -352,10 +352,14 @@ body {
|
|
|
352
352
|
gap: 30px;
|
|
353
353
|
font-size: 12px;
|
|
354
354
|
}
|
|
355
|
+
.otp-icon {
|
|
356
|
+
position: relative;
|
|
357
|
+
top: 2px;
|
|
358
|
+
}
|
|
355
359
|
|
|
356
360
|
.ant-radio-wrapper {
|
|
357
361
|
display: flex;
|
|
358
|
-
align-items: center;
|
|
362
|
+
// align-items: center;
|
|
359
363
|
gap: 6px;
|
|
360
364
|
|
|
361
365
|
svg {
|