esbenp / lumen-api-oauth

The code for a blog post I wrote about creating web apps using a Lumen API that is authenticated by OAuth2
http://esbenp.github.io/2015/05/26/lumen-web-api-oauth-2-authentication/
61 stars 22 forks source link

How to make dynamic login ? #17

Closed prashantidealittechno closed 8 years ago

prashantidealittechno commented 8 years ago

Can anybody help me to make it dynamic login, currently in client.js file has following code - url: "/index.php/login", method: "POST", data: { credentials: { username: 'user@user.com', password: '1234' } },

I want to set username = whatever I post and same for the password.

I just want to call it through - postman like - http://wikilocal.mysite.com/index.php/login method - post parameters - username - any-user-name password - my-password

is it possible ?

Thank you.

esbenp commented 8 years ago

If you mean when having a form, you could just reference the fields value in the client.js

client.js

url: "/index.php/login",
method: "POST",
data: {
credentials: {
username: document.getElementById('email').value,
password: document.getElementById('password').value
}
},