File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -55,12 +55,12 @@ public function Login() {
55
55
);
56
56
// set cookie + set session
57
57
$ this ->input ->set_cookie ($ cookie );
58
- if ($ _SESSION ['nonces ' ]==$ post ['nonces ' ]) {
58
+ if ($ _SESSION ['nonces ' ]==$ post ['nonces ' ] && $ this -> input -> get_request_header ( ' login-custom-header ' , TRUE )== ' login-csrf ' ) {
59
59
// VALID TOKEN PROVIDED - PROCEED WITH PROCESS
60
60
$ response = array ('status ' =>'2 ' ,'msg ' =>'success ' ,'data ' =>$ user ['data ' ]);
61
61
echo json_encode ($ response );
62
62
} else {
63
- $ response = array ('status ' =>'0 ' ,'msg ' =>'failed ' ,'data ' =>'nonces error ' );
63
+ $ response = array ('status ' =>'0 ' ,'msg ' =>'failed ' ,'data ' =>'nonces error or login-custom-header error ' );
64
64
echo json_encode ($ response );
65
65
}
66
66
}else {
Original file line number Diff line number Diff line change 47
47
type: "post",
48
48
data: values,
49
49
url: "./Login/Login",
50
+ headers: { 'login-custom-header': 'login-csrf' },
50
51
dataType: 'json',
51
52
success: function(data) {
52
53
if(data.status == 2){
You can’t perform that action at this time.
0 commit comments