Giriş ve çıkış fonksiyonları iyileştirildi.

This commit is contained in:
Batuhan 2025-02-16 10:21:47 +03:00
parent 34e2b143fa
commit 61b2001f26
3 changed files with 11 additions and 4 deletions

View File

@ -45,6 +45,10 @@ export default class App extends Component {
serverOptions: { serverOptions: {
endBack: { endBack: {
url: "http://192.168.1.27:3001" url: "http://192.168.1.27:3001"
},
backEnd: {
title: "Node",
url: "http://192.168.1.27:3001"
} }
}, },
auth: false, auth: false,
@ -97,7 +101,7 @@ export default class App extends Component {
if(cookies.get("auth") === "Success"){ if(cookies.get("auth") === "Success"){
return ( return (
<div className='flex flex-col h-screen overflow-hidden'> <div className='flex flex-col h-screen overflow-hidden'>
<Header/> <Header state={this.state}/>
<div className='flex flex-col h-screen overflow-hidden p-4'> <div className='flex flex-col h-screen overflow-hidden p-4'>
<div className='flex flex-col h-screen overflow-hidden gap-4'> <div className='flex flex-col h-screen overflow-hidden gap-4'>
<div className='grid grid-cols-5 h-full overflow-hidden gap-4'> <div className='grid grid-cols-5 h-full overflow-hidden gap-4'>
@ -125,11 +129,11 @@ export default class App extends Component {
}else{ }else{
return( return(
<div className='flex flex-col h-screen overflow-hidden'> <div className='flex flex-col h-screen overflow-hidden'>
<Header/> <Header state={this.state}/>
<div className='flex flex-col h-screen overflow-hidden p-4'> <div className='flex flex-col h-screen overflow-hidden p-4'>
<div className='flex flex-col h-screen overflow-hidden gap-4'> <div className='flex flex-col h-screen overflow-hidden gap-4'>
<div className='grid grid-cols-5 h-full overflow-hidden gap-4'> <div className='grid grid-cols-5 h-full overflow-hidden gap-4'>
<div className='flex col-span-5 h-full overflow-y-scroll bg-white rounded-2xl p-4'> <div className='flex col-span-5 h-full w-full items-center justify-center overflow-y-scroll bg-white rounded-2xl p-4'>
<Login state={this.state} functions={this.functions}/> <Login state={this.state} functions={this.functions}/>
</div> </div>
</div> </div>

View File

@ -8,7 +8,7 @@ export class Header extends PureComponent {
<a className='font-bold' href='/'>Wondanes - Ele Mele Ǩismeti</a> <a className='font-bold' href='/'>Wondanes - Ele Mele Ǩismeti</a>
</div> </div>
<div> <div>
<a className='p-2 rounded-lg cursor-pointer hover:bg-white hover:bg-opacity-70' href='/logout'>Çıkış Yap</a> <a className='p-2 rounded-lg cursor-pointer hover:bg-white hover:bg-opacity-70' href={this.props.state.serverOptions.backEnd.url + "/logout"}>Çıkış Yap</a>
</div> </div>
</div> </div>
) )

View File

@ -17,6 +17,9 @@ export default function Auth(url) {
cookies.set('auth', 'Success', { path: '/' }); cookies.set('auth', 'Success', { path: '/' });
}else{ }else{
cookies.set('auth', 'Failed', { path: '/' }); cookies.set('auth', 'Failed', { path: '/' });
if(window.location.pathname !== "/login"){
window.location.pathname = "/login";
};
}; };
}); });
}; };