Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c130c056f8 |
@@ -1,5 +1,4 @@
|
|||||||
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";
|
||||||
@@ -68,18 +67,14 @@ export default function VerifyYou() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let apiInput = {
|
let apiInput = {
|
||||||
username: 'anumuduchukwuebuka@gmail.com',
|
username: localStorage.getItem('username'),
|
||||||
pend_uid: 'ec497517-ddb5-4830-a2c4-b7e2a68627de',
|
pend_uid: localStorage.getItem('uuid'),
|
||||||
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.signupOTPVerify(apiInput);
|
const res = await verifyOTP.signupUser(apiInput)
|
||||||
console.log(res)
|
|
||||||
if(res.status != 200){
|
if(res.status != 200){
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
setErrorMessage({
|
setErrorMessage({
|
||||||
@@ -88,15 +83,33 @@ export default function VerifyYou() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if status code is 200 proceed
|
|
||||||
setErrorMessage({
|
if(res.status == 200){
|
||||||
success: true,
|
if(res.data.status < 0) { // when resquest is successful but status is not 100
|
||||||
message: 'verification successfully'
|
setLoading(false)
|
||||||
})
|
setErrorMessage({
|
||||||
setTimeout(()=>{
|
success: false,
|
||||||
setLoading(false)
|
message: res.data.error_msg
|
||||||
navigate('/complete-signup', { replace: true })
|
})
|
||||||
}, 1000)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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,6 +62,8 @@ 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) {
|
||||||
@@ -100,7 +102,7 @@ export default function SignUp() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await userSignup.signupUser(userInfo);
|
const res = await userSignup.signupUser(userInfo);
|
||||||
if(res.status != 200 || res.data.status < 1){
|
if(res.status != 200){
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
setErrorMessage({
|
setErrorMessage({
|
||||||
success: false,
|
success: false,
|
||||||
@@ -108,15 +110,31 @@ export default function SignUp() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if status code is 200 proceed
|
|
||||||
setErrorMessage({
|
if(res.status == 200){
|
||||||
success: true,
|
if(res.data.status < 0) { // when resquest is successful but status is not 1
|
||||||
message: 'Account created successfully'
|
setLoading(false)
|
||||||
})
|
setErrorMessage({
|
||||||
setTimeout(()=>{
|
success: false,
|
||||||
setLoading(false)
|
message: 'unable to create account'
|
||||||
navigate("/verify-signup", { replace: true })
|
})
|
||||||
}, 1000)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 || !category || !mode){
|
if(!description || !notes || !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,7 +669,6 @@ 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 {
|
||||||
@@ -678,7 +677,6 @@ TODO: Responsive ===========================
|
|||||||
.notification-page .content-item .notifications .icon {
|
.notification-page .content-item .notifications .icon {
|
||||||
@apply mb-2;
|
@apply mb-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calendar */
|
/* Calendar */
|
||||||
@@ -768,11 +766,6 @@ 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;
|
||||||
@@ -790,7 +783,6 @@ 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,11 +25,6 @@ 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