Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 171cd64

Browse files
authored
Merge pull request #3 from kb1000fx/master
Fixed noSession Error
2 parents 4b65695 + fcdbf6d commit 171cd64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/omenhelper/Omen/Login.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class Login {
3131

3232
HttpUtil2 httpUtil2 = new HttpUtil2();
3333
private String backendCsrf;
34+
private String baseUrl;
3435

3536
public Login() {
3637
}
@@ -77,6 +78,7 @@ public void webPrepare(){
7778
HttpUtilEntity temp = httpUtil2.doStreamPost(backendUrl, JsonUtil.obj2String(body).getBytes(StandardCharsets.UTF_8), header);
7879
Map result = JsonUtil.string2Obj(temp.getBody(), Map.class);
7980
backendCsrf = (String) result.get("csrfToken");
81+
baseUrl = (String) result.get("regionEndpointUrl");
8082

8183
} catch (IOException e) {
8284
e.printStackTrace();
@@ -86,7 +88,7 @@ public void webPrepare(){
8688
}
8789

8890
public void idpProvider(){
89-
String url = "https://ui-backend.us-west-2.id.hp.com/bff/v1/session/check-username";
91+
String url = baseUrl + "/session/check-username";
9092
Map<String, String> data = new HashMap<String, String>(){{
9193
put("username", email);
9294
}};
@@ -117,7 +119,7 @@ public void idpProvider(){
117119
}
118120
public String webLogin(){
119121

120-
String loginAddr = "https://ui-backend.us-west-2.id.hp.com/bff/v1/session/username-password";
122+
String loginAddr = baseUrl + "/session/username-password";
121123
Map<String, String> data = new HashMap<String, String>(){{
122124
put("username", email + "@" + idpProvider);
123125
put("password", pass);

0 commit comments

Comments
 (0)