@@ -422,7 +422,7 @@ function Login() {
422
422
alert ( "Somenthing went wrong, please try again later!" ) ;
423
423
}
424
424
} ;
425
- const thirdpartyLoginfn = async ( sessionToken , billingDate ) => {
425
+ const thirdpartyLoginfn = async ( sessionToken ) => {
426
426
const baseUrl = localStorage . getItem ( "baseUrl" ) ;
427
427
const parseAppId = localStorage . getItem ( "parseAppId" ) ;
428
428
const res = await axios . get ( baseUrl + "users/me" , {
@@ -521,7 +521,7 @@ function Login() {
521
521
await Parse . Cloud . run ( "getUserDetails" , {
522
522
email : currentUser . get ( "email" )
523
523
} ) . then (
524
- ( result ) => {
524
+ async ( result ) => {
525
525
let tenentInfo = [ ] ;
526
526
const results = [ result ] ;
527
527
if ( results ) {
@@ -571,7 +571,7 @@ function Login() {
571
571
setState ( { ...state , loading : false } ) ;
572
572
navigate ( "/" ) ;
573
573
} else {
574
- extendedInfo . forEach ( ( x ) => {
574
+ extendedInfo . forEach ( async ( x ) => {
575
575
if ( x . TenantId ) {
576
576
let obj = {
577
577
tenentId : x . TenantId . objectId ,
@@ -608,8 +608,13 @@ function Login() {
608
608
setThirdpartyLoader ( false ) ;
609
609
setState ( { ...state , loading : false } ) ;
610
610
if ( isEnableSubscription ) {
611
- if ( billingDate ) {
612
- if ( billingDate > new Date ( ) ) {
611
+ const res = await fetchSubscription ( ) ;
612
+ const freeplan = res . plan ;
613
+ const billingDate = res . billingDate ;
614
+ if ( freeplan === "freeplan" ) {
615
+ navigate ( redirectUrl ) ;
616
+ } else if ( billingDate ) {
617
+ if ( new Date ( billingDate ) > new Date ( ) ) {
613
618
localStorage . removeItem ( "userDetails" ) ;
614
619
navigate ( redirectUrl ) ;
615
620
} else {
@@ -644,8 +649,13 @@ function Login() {
644
649
setState ( { ...state , loading : false } ) ;
645
650
setThirdpartyLoader ( false ) ;
646
651
if ( isEnableSubscription ) {
647
- if ( billingDate ) {
648
- if ( billingDate > new Date ( ) ) {
652
+ const res = await fetchSubscription ( ) ;
653
+ const freeplan = res . plan ;
654
+ const billingDate = res . billingDate ;
655
+ if ( freeplan === "freeplan" ) {
656
+ navigate ( redirectUrl ) ;
657
+ } else if ( billingDate ) {
658
+ if ( new Date ( billingDate ) > new Date ( ) ) {
649
659
localStorage . removeItem ( "userDetails" ) ;
650
660
// Redirect to the appropriate URL after successful login
651
661
navigate ( redirectUrl ) ;
0 commit comments