You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As for passing custom headers from the login form, the SDK currently does not support this. However, the Accept header will automatically be set to application/json, and the Content-Type will be set to application/json as well, when talking to one of the Stormpath back-end integrations.
As for formatting the custom data, you can do it like this:
onSubmit(event,next){constdata={action: 'login',data: event.data// event.data contains username and password fields by default};// next (err, data)next(null,data);}
// If defined, onSubmit will be called before handing anything over to the API<LoginFormonSubmit={this.onSubmit.bind(this)}/>
@robertjd Maybe we should add an example of this in the example app?
I want to make a Login API call which accept following parameters:
{ "action":"login",
"data":{
"username": "[email protected]",
"password":"123456"
}
}
I want to pass such data to onFormSubmit callback of LoginPage and want to set the headers as well.
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
How can I pass post data with headers in Login API call?
Please give an example for that.
The text was updated successfully, but these errors were encountered: