File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,9 @@ function Profile({ peopleType }) {
105105 }
106106 const logout = async ( e ) => {
107107 try {
108- window . location . reload ( ) ;
109- const response = await axios . get ( `${ SERVER_URL } /dept/${ dept } /logout` , { withCredentials : true } ) ;
108+ window . location . reload ( false ) ;
109+ console . log ( "Logout" )
110+ const response = await axios . post ( `${ SERVER_URL } /dept/${ dept } /logout` , { } , { withCredentials : false } ) ;
110111 navigate ( `/dept/${ dept } /Faculty` ) ;
111112 } catch ( error ) {
112113 console . log ( error ) ;
@@ -149,7 +150,7 @@ function Profile({ peopleType }) {
149150 < a title = "Download Profile as PDF" href = '#' className = 'w-8 sm:w-10 mt-1 mx-2 active:translate-y-[2px]' >
150151 < img src = { downloadpdf } alt = "download pdf" className = 'w-full' />
151152 </ a >
152- < button onClick = { ( ) => { ! data ?. validation ?. status ?. login ? navigate ( `/dept/${ dept } /login` ) : logout ( ) } } className = { "bg-[#0054A6] mx-4 text-white text-xs xl:text-base duration-500 w-20 xl:w-24 py-2 px-2 text-center h-[1.875rem] xl:h-10 shadow-md border border-[#FFD66E] rounded hover:-translate-y-1 hover:scale-110" } >
153+ < button onClick = { ( ) => { ! data ?. validation ?. status ?. login && navigate ( `/dept/${ dept } /login` ) } } className = { "bg-[#0054A6] mx-4 text-white text-xs xl:text-base duration-500 w-20 xl:w-24 py-2 px-2 text-center h-[1.875rem] xl:h-10 shadow-md border border-[#FFD66E] rounded hover:-translate-y-1 hover:scale-110" } >
153154 { ! data ?. validation ?. status ?. login ? "Login" : "Logout" }
154155 </ button >
155156 </ div >
Original file line number Diff line number Diff line change 1- const SERVER_URL = "https://teamcbackend .onrender.com"
1+ const SERVER_URL = "https://wdmc-vsj1 .onrender.com"
22module . exports = { SERVER_URL }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const useFetch = (url) => {
1212 try {
1313 console . log ( SERVER_URL + url ) ;
1414 const res = await axios . get ( SERVER_URL + url , {
15- withCredentials : true ,
15+ withCredentials : false ,
1616 } ) ;
1717
1818 setData ( res . data ) ;
You can’t perform that action at this time.
0 commit comments