Giriş ve çıkış fonksiyonları iyileştirildi.
This commit is contained in:
parent
34e2b143fa
commit
61b2001f26
10
src/App.js
10
src/App.js
@ -45,6 +45,10 @@ export default class App extends Component {
|
||||
serverOptions: {
|
||||
endBack: {
|
||||
url: "http://192.168.1.27:3001"
|
||||
},
|
||||
backEnd: {
|
||||
title: "Node",
|
||||
url: "http://192.168.1.27:3001"
|
||||
}
|
||||
},
|
||||
auth: false,
|
||||
@ -97,7 +101,7 @@ export default class App extends Component {
|
||||
if(cookies.get("auth") === "Success"){
|
||||
return (
|
||||
<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 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{
|
||||
return(
|
||||
<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 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}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -8,7 +8,7 @@ export class Header extends PureComponent {
|
||||
<a className='font-bold' href='/'>Wondanes - Ele Mele Ǩismeti</a>
|
||||
</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>
|
||||
)
|
||||
|
||||
@ -17,6 +17,9 @@ export default function Auth(url) {
|
||||
cookies.set('auth', 'Success', { path: '/' });
|
||||
}else{
|
||||
cookies.set('auth', 'Failed', { path: '/' });
|
||||
if(window.location.pathname !== "/login"){
|
||||
window.location.pathname = "/login";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user