Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Implementing a UserDetailsService

Ivan Valdes
Ivan Valdes
2,982 Points

Errror with user authentication

Hi, How i like to learn by creating my own applications I'm creating a card game but i'm having some issues with the user authentication.

I'm using spring and Angularjs.

The login form is the following: <div id="container" class="container" ng-controller="loginController"> <div id="card card-login card-container" class="card card-login card-container"> <img id="profile-img" class="profile-img-card" src="images/logo.png" /> <p id="profile-name" class="profile-name-card"></p> <form class="form-signin" ng-submit="loginUser()"> <div id="h1-login" class="h1-login">Truco app</div> <span id="reauth-user" class="reauth-user"></span> <input type="text" id="inputUser" class="form-control" placeholder="Username" th:required="required" autofocus="true" ng-model="credentials.username"/> <input type="password" id="inputPassword" class="form-control" placeholder="Password" th:required="required" ng-model="credentials.password"/> <button class="btn btn-lg btn-primary btn-block btn-signin" type="submit">Sign in</button> </form><!-- /form --> <a href="menu.html" id="create-user" class="create-user btn btn-lg"> <span class="glyphicon glyphicon-user"></span>Create user </a> </div> </div>

How can I login a user? What should the loginUser function do? is a Post or a Get? What should the controller do?

I'm using Mysql as database.