Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4dd99ec2d9 | |||
| 3ef3297dfc |
@@ -1,4 +1,5 @@
|
|||||||
import React, {useState} from "react";
|
import React, {useState} from "react";
|
||||||
|
// import titleShape from "../../../../assets/images/shape/text-shape-three.svg";
|
||||||
import titleShape from "../../../../assets/images/shape/title_shape_3.svg";
|
import titleShape from "../../../../assets/images/shape/title_shape_3.svg";
|
||||||
import AuthLayout from "../../AuthLayout";
|
import AuthLayout from "../../AuthLayout";
|
||||||
import Otp from "./Otp";
|
import Otp from "./Otp";
|
||||||
@@ -67,14 +68,18 @@ export default function VerifyYou() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let apiInput = {
|
let apiInput = {
|
||||||
username: localStorage.getItem('username'),
|
username: 'anumuduchukwuebuka@gmail.com',
|
||||||
pend_uid: localStorage.getItem('uuid'),
|
pend_uid: 'ec497517-ddb5-4830-a2c4-b7e2a68627de',
|
||||||
random_text: otpCode,
|
random_text: otpCode,
|
||||||
mode: 'VERIFY',
|
mode: 'VERIFY',
|
||||||
|
// loc: 'Desktop',
|
||||||
|
// sessionid: 'ec497517-ddb5-4830-a2c4-b7e2a68627de',
|
||||||
|
// code: otpCode,
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await verifyOTP.signupUser(apiInput)
|
const res = await verifyOTP.signupOTPVerify(apiInput);
|
||||||
|
console.log(res)
|
||||||
if(res.status != 200){
|
if(res.status != 200){
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
setErrorMessage({
|
setErrorMessage({
|
||||||
@@ -83,33 +88,15 @@ export default function VerifyYou() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// if status code is 200 proceed
|
||||||
if(res.status == 200){
|
setErrorMessage({
|
||||||
if(res.data.status < 0) { // when resquest is successful but status is not 100
|
success: true,
|
||||||
setLoading(false)
|
message: 'verification successfully'
|
||||||
setErrorMessage({
|
})
|
||||||
success: false,
|
setTimeout(()=>{
|
||||||
message: res.data.error_msg
|
setLoading(false)
|
||||||
})
|
navigate('/complete-signup', { replace: true })
|
||||||
return
|
}, 1000)
|
||||||
}
|
|
||||||
|
|
||||||
// if request is successful and status is 100 proceed
|
|
||||||
setErrorMessage({
|
|
||||||
success: true,
|
|
||||||
message: 'verification successfully'
|
|
||||||
})
|
|
||||||
|
|
||||||
//clears the temporary uuid and email in tge local storage
|
|
||||||
localStorage.removeItem('uuid')
|
|
||||||
localStorage.removeItem('username')
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
|
||||||
setLoading(false)
|
|
||||||
navigate('/complete-signup', { replace: true })
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
setErrorMessage({
|
setErrorMessage({
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ export default function SignUp() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//checks if email is a valid email address
|
//checks if email is a valid email address
|
||||||
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
||||||
if (regEx.test(email) == false) {
|
if (regEx.test(email) == false) {
|
||||||
@@ -102,7 +100,7 @@ export default function SignUp() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await userSignup.signupUser(userInfo);
|
const res = await userSignup.signupUser(userInfo);
|
||||||
if(res.status != 200){
|
if(res.status != 200 || res.data.status < 1){
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
setErrorMessage({
|
setErrorMessage({
|
||||||
success: false,
|
success: false,
|
||||||
@@ -110,31 +108,15 @@ export default function SignUp() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// if status code is 200 proceed
|
||||||
if(res.status == 200){
|
setErrorMessage({
|
||||||
if(res.data.status < 0) { // when resquest is successful but status is not 1
|
success: true,
|
||||||
setLoading(false)
|
message: 'Account created successfully'
|
||||||
setErrorMessage({
|
})
|
||||||
success: false,
|
setTimeout(()=>{
|
||||||
message: 'unable to create account'
|
setLoading(false)
|
||||||
})
|
navigate("/verify-signup", { replace: true })
|
||||||
return
|
}, 1000)
|
||||||
}
|
|
||||||
|
|
||||||
// if request is successful and status is 1 proceed
|
|
||||||
setErrorMessage({
|
|
||||||
success: true,
|
|
||||||
message: 'Account created successfully'
|
|
||||||
})
|
|
||||||
|
|
||||||
localStorage.setItem('uuid', res.data.uuid) // Stores the user UUID to localstorage
|
|
||||||
localStorage.setItem('username', email) // Stores the user UUID to localstorage
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
|
||||||
setLoading(false)
|
|
||||||
navigate("/verify-signup", { replace: true })
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
setErrorMessage({
|
setErrorMessage({
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default function AddEditReminder({ className }) {
|
|||||||
setMessage({status: true, message: ''})
|
setMessage({status: true, message: ''})
|
||||||
let {description, notes, category, mode} = infoDetail
|
let {description, notes, category, mode} = infoDetail
|
||||||
//CHECKING IF AN EMPTY FIELD WAS PASSED
|
//CHECKING IF AN EMPTY FIELD WAS PASSED
|
||||||
if(!description || !notes || !category || !mode){
|
if(!description || !category || !mode){
|
||||||
setSuccess(false)
|
setSuccess(false)
|
||||||
setMessage({status: false, message: 'All fields must be filled'})
|
setMessage({status: false, message: 'All fields must be filled'})
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -669,6 +669,7 @@ TODO: Responsive ===========================
|
|||||||
.nft-userprofile-wrapper .content-wrapper-profile-only .auth {
|
.nft-userprofile-wrapper .content-wrapper-profile-only .auth {
|
||||||
margin-top: -70px;
|
margin-top: -70px;
|
||||||
}
|
}
|
||||||
|
.react-date-picker__calendar {width: 290px;}
|
||||||
}
|
}
|
||||||
@media (max-width: 376px) {
|
@media (max-width: 376px) {
|
||||||
.notification-page .content-item .notifications {
|
.notification-page .content-item .notifications {
|
||||||
@@ -677,6 +678,7 @@ TODO: Responsive ===========================
|
|||||||
.notification-page .content-item .notifications .icon {
|
.notification-page .content-item .notifications .icon {
|
||||||
@apply mb-2;
|
@apply mb-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calendar */
|
/* Calendar */
|
||||||
@@ -766,6 +768,11 @@ TODO: Responsive ===========================
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Date Picker */
|
/* Date Picker */
|
||||||
|
.react-date-picker{
|
||||||
|
display: flex !important;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.react-date-picker__wrapper{
|
.react-date-picker__wrapper{
|
||||||
border: 0.5px solid #E3E4FE;
|
border: 0.5px solid #E3E4FE;
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
@@ -783,6 +790,7 @@ TODO: Responsive ===========================
|
|||||||
|
|
||||||
.dark .react-date-picker__button svg{stroke: #7B818D;}
|
.dark .react-date-picker__button svg{stroke: #7B818D;}
|
||||||
|
|
||||||
|
.react-date-picker__calendar {inset: 100% 25px auto auto !important;}
|
||||||
.react-date-picker__calendar .react-calendar{
|
.react-date-picker__calendar .react-calendar{
|
||||||
min-height: 18.4rem;
|
min-height: 18.4rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ class usersService {
|
|||||||
return this.postAuxEnd("/account", reqData);
|
return this.postAuxEnd("/account", reqData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//SIGNUP OTP VERIFICATION AUTH
|
||||||
|
signupOTPVerify(reqData){
|
||||||
|
return this.postAuxEnd("/signup-code", reqData);
|
||||||
|
}
|
||||||
|
|
||||||
getUserReminders(){
|
getUserReminders(){
|
||||||
var reqData = {
|
var reqData = {
|
||||||
member_id: localStorage.getItem("member_id")
|
member_id: localStorage.getItem("member_id")
|
||||||
|
|||||||
Reference in New Issue
Block a user