Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform login #20

Open
yamila-fraiman opened this issue Jan 7, 2017 · 1 comment
Open

Perform login #20

yamila-fraiman opened this issue Jan 7, 2017 · 1 comment

Comments

@yamila-fraiman
Copy link

Hi, i am trying to perform a login but I can't get it working.
This is my code in Login Manager. How should I call performLogin in my login activity (I know It shouldn't be in the UI thread)?

RequestConfig config = new RequestConfig();
        config.setResponseFormat(BaseRequest.ResponseFormat.JSON);
        config.setRequestFormat(BaseRequest.RequestFormat.JSON);
        BaseRequest loginRequest = new BaseRequest(BaseRequest.RequestMethod.GET, "http://192.168.1.4:4000/api/v1/auth", config);
        loginRequest.addRequestHeader("username", username);
        loginRequest.addRequestHeader("password", password);
        //loginRequest.setPriority(Request.Priority.IMMEDIATE);
        ResponseData loginResponseData = loginRequest.performRequest(true, queue);
        return loginResponseData;
@TarasKunyk
Copy link
Member

Hello,
You are right: login command is supposed to be triggered from background thread using
Model.getInstance().performLogin(...) call
Additionally you can implement access token storing within login manager implementation and add it to each request within applyLoginDataToRequest method (in case if you are not using regular cookie-based session tracking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants