@@ -8,6 +8,17 @@ $(document).ready(function(){
88    var  formSubmitted  =  urlParams . get ( 'form_submitted' ) ; 
99    var  formType  =  urlParams . get ( 'form_type' ) ; 
1010
11+     var  userAuthenticated  =  urlParams . get ( 'auth' ) ; 
12+ 
13+     var  current_search_location  =  window . location ; 
14+     if ( current_search_location . toString ( ) . search ( 'teams' ) > 0 ) { 
15+         var  is_authenticated  =  Cookies . set ( 'authenticated' ) ; 
16+         var  username  =  Cookies . set ( 'username' ) ; 
17+         if ( is_authenticated  !==  true  &&  username  ===  undefined ) { 
18+             window . location  =  window . location . origin  +  '?auth=false' ; 
19+         } 
20+     } 
21+ 
1122    if ( formSubmitted === 'True' ) { 
1223        var  message  =  '' ; 
1324        if ( formType === 'login' ) { 
@@ -30,6 +41,13 @@ $(document).ready(function(){
3041        $ ( '.important-message' ) . text ( message ) ; 
3142        $ ( '.form-submission-popup' ) . css ( 'display' ,  'block' ) ; 
3243    } 
44+     else  if ( userAuthenticated  ===  'false' ) { 
45+         $ ( '.important-message' ) . text ( 
46+           'You tried to access a webpage, which is available to only'  + 
47+           ' authenticated users. Please join the community or Login(if'  + 
48+           ' already a member of organization)' ) ; 
49+         $ ( '.form-submission-popup' ) . css ( 'display' ,  'block' ) ; 
50+     } 
3351
3452    function  activate_dropdown ( ) { 
3553        if  ( $ ( 'nav' ) . width ( )  <  992  ) { 
@@ -44,7 +62,7 @@ $(document).ready(function(){
4462
4563    function  check_user_authenticated_or_not ( )  { 
4664        if ( Cookies . get ( 'authenticated' ) ) { 
47-             modify_html_elements ( 'none' ,  'none' , 'block' ,  'block' ) ; 
65+             modify_html_elements ( 'none' ,  'none' , 'block' ,  'block' ,   'block' ) ; 
4866        } 
4967    } 
5068
@@ -60,11 +78,12 @@ $(document).ready(function(){
6078
6179    function  modify_html_elements ( popup_form_display ,  login_option_display , 
6280                                  logout__option_display , 
63-                                   form_option_display )  { 
81+                                   form_option_display ,   teams_option_display )  { 
6482        $ ( '.form-popup' ) . css ( 'display' ,  popup_form_display ) ; 
6583        login_user_el . css ( 'display' ,  login_option_display ) ; 
6684        logout_user_el . css ( 'display' ,  logout__option_display ) ; 
6785        $ ( '.forms-dropdown-option' ) . css ( 'display' ,  form_option_display ) ; 
86+         $ ( '.teams-dropdown-option' ) . css ( 'display' ,  teams_option_display ) ; 
6887    } 
6988
7089    function  manipulate_web_page_data ( oauth_provider ,  http_response_text )  { 
@@ -73,7 +92,7 @@ $(document).ready(function(){
7392            // Cookies expires in 3 days 
7493            Cookies . set ( 'authenticated' ,  true ,  { expires : 3 } ) ; 
7594            Cookies . set ( 'username' ,  json_data . user ,  { expires : 3 } ) ; 
76-             modify_html_elements ( 'none' ,  'none' , 'block' ,  'block' ) ; 
95+             modify_html_elements ( 'none' ,  'none' , 'block' ,  'block' ,   'block' ) ; 
7796        } 
7897        else  { 
7998            display_error_message ( oauth_provider ,  json_data . message ) ; 
@@ -144,7 +163,7 @@ $(document).ready(function(){
144163    logout_user_el . click ( function  ( )  { 
145164        Cookies . remove ( 'authenticated' ) ; 
146165        Cookies . remove ( 'username' ) ; 
147-         modify_html_elements ( 'none' ,  'block' , 'none' ,  'none' ) ; 
166+         modify_html_elements ( 'none' ,  'block' , 'none' ,  'none' ,   'none' ) ; 
148167    } ) ; 
149168
150169    $ ( '.login-with-github' ) . click ( function ( e )  { 
0 commit comments