Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action='auth' method='POST' id='loginForm' class='cssform' autocomplete='off'>
- <p>
- <label for='j_username'>Login ID</label>
- <input type='text' class='text_' name='j_username' id='j_username' />
- </p>
- <p>
- <label for='j_password'>Password</label>
- <input type='password' class='text_' name='j_password' id='j_password' />
- </p>
- <p>
- <input type='submit' value='Login' />
- </p>
- class LoginController {
- def index() {
- if (session.user?.name == 'test') {
- render view: '/login/youarealreadyin'
- }
- else {
- render view: '/login/auth'
- }
- }
- def auth() {
- def loginName = params.j_username?.trim()
- def pass = params.j_password?.trim()
- if (loginName == 'test' && pass == 'TEST' ) {
- session.user = [name: loginName]
- redirect uri: '/'
- }
- else {
- render view: '/login/denied'
- }
- }
- http://localhost:8080/?j_username=test&j_password=TEST
Add Comment
Please, Sign In to add comment