Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('#signIn').submit(function(){
- var a = $('#email').val();
- $.post('/api/login', { //this used to post to verifyUser.php
- Username: $('#email').val(),
- Password: $('#password').val()
- }, function(data){
- if(data['credentials'] == true){
- console.log('credentials true');
- console.log(data['uri']);
- window.location.href=data['uri'];
- } else {
- $('#errMsg').html(data['errMsg']);
- $('.alert').show();
- }
- }, 'json');
- return false;
- });
- public function authenticate(Request $request) //aka api/login endpoint
- {
- //...
- $legacyRes = $this->authenticateLegacy($request);
- //...
- }
- private function authenticateLegacy(Request $request)
- {
- $response = null;
- try {
- $response = $this->client->post('/admin/verifyUser.php', [
- 'form_params' => ['Username' => $request->get('Username'),
- 'Password' => $request->get('Password')]
- ]);
- }
- catch(Exception $exception){
- Log::error('Errrererererer', [$exception->getMessage()]);
- }
- $body = (string)$response->getBody();
- Log::info('BODY:', [$body]);
- return $body;
- }
Add Comment
Please, Sign In to add comment