File tree 3 files changed +6
-5
lines changed
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,9 @@ function Profile({ peopleType }) {
105
105
}
106
106
const logout = async ( e ) => {
107
107
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 } ) ;
110
111
navigate ( `/dept/${ dept } /Faculty` ) ;
111
112
} catch ( error ) {
112
113
console . log ( error ) ;
@@ -149,7 +150,7 @@ function Profile({ peopleType }) {
149
150
< a title = "Download Profile as PDF" href = '#' className = 'w-8 sm:w-10 mt-1 mx-2 active:translate-y-[2px]' >
150
151
< img src = { downloadpdf } alt = "download pdf" className = 'w-full' />
151
152
</ 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" } >
153
154
{ ! data ?. validation ?. status ?. login ? "Login" : "Logout" }
154
155
</ button >
155
156
</ 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"
2
2
module . exports = { SERVER_URL }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const useFetch = (url) => {
12
12
try {
13
13
console . log ( SERVER_URL + url ) ;
14
14
const res = await axios . get ( SERVER_URL + url , {
15
- withCredentials : true ,
15
+ withCredentials : false ,
16
16
} ) ;
17
17
18
18
setData ( res . data ) ;
You can’t perform that action at this time.
0 commit comments