Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SecurityController extends Controller {
- /**
- * @Route("/login", name="login_form")
- */
- public function loginAction(Request $request) {
- $session = $request->getSession();
- // get the login error if there is one
- $error = $session->get(Security::AUTHENTICATION_ERROR);
- $session->remove(Security::AUTHENTICATION_ERROR);
- return new JsonResponse($session);
- }
- var cardCollectionControllers = angular.module('cardCollectionControllers');cardCollectionControllers.controller('LoginCtrl', ['$scope', '$http',
- function($scope, $http) {
- $scope.user = {};
- $scope.login = function() {
- $http({
- method : 'POST',
- url : 'http://localhost:8080/card_collection_backend/web/app_dev.php/login',
- data : encodeURIComponent('username=' + $scope.username +'&password=' + $scope.password),
- headers : {'Content-Type': 'application/x-www-form-urlencoded'}
- })
- .success(function(data) {
- //what to do here?
- });
- };}]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement