Hello Guys,
I am following along with the tutorial
http://www.angularcode.com/user-authentication-using-angularjs-php-mysql/
I am having a problem with the routing. Basically, the way it works is when
you click on log in it goes to authentication.php and then it loads login
and it decodes the json
Here is part of the authentication.php that deals with login.
$app->post('/login', function() use ($app) {
require_once 'passwordHash.php';
$r = json_decode($app->request->getBody());
verifyRequiredParams(array('email', 'password'),$r->customer);
$response = array();
$db = new DbHandler();
$password = $r->customer->password;
$email = $r->customer->email;
$user = $db->getOneRecord("select uid,name,password,email,created from
customers_auth where phone='$email' or email='$email'");
if ($user != NULL) {
if(passwordHash::check_password($user['password'],$password)){
$response['status'] = "success";
$response['message'] = 'Logged in successfully.';
$response['name'] = $user['name'];
$response['uid'] = $user['uid'];
$response['email'] = $user['email'];
$response['createdAt'] = $user['created'];
if (!isset($_SESSION)) {
session_start();
}
$_SESSION['uid'] = $user['uid'];
$_SESSION['email'] = $email;
$_SESSION['name'] = $user['name'];
} else {
$response['status'] = "error";
$response['message'] = 'Login failed. Incorrect credentials';
}
}else {
$response['status'] = "error";
$response['message'] = 'No such user is registered';
}
echoResponse(200, $response);
});
The issue I have is it says login is not found. I believe it because of the
web.cong file.
I converted this
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]
to This
<rule name="rule 1E" stopprocessing="true">
<match url="^(.*)$"/>
<action type="Rewrite" url="/%{ENV:BASE}index.php"
appendquerystring="true"/>
</rule>
Screen cast of firebug - http://screencast.com/t/FXgo7ZPZ
Still no luck. Can some one give me a helping hand?
Thanks, Dan
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.