Remove some unnecessary code
This commit is contained in:
parent
ff5fd9f6d4
commit
fe6dd78193
|
@ -1,36 +0,0 @@
|
|||
package com.app;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Cookie;
|
||||
import okhttp3.CookieJar;
|
||||
import okhttp3.HttpUrl;
|
||||
|
||||
public class UnsecureCookieJar implements CookieJar {
|
||||
|
||||
private Map<String, Cookie> cookies = new HashMap<>();
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Cookie> loadForRequest(@NotNull HttpUrl httpUrl) {
|
||||
Log.d("Skolplattformen", "Loading cookies!");
|
||||
return new ArrayList<>(cookies.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveFromResponse(@NotNull HttpUrl httpUrl, @NotNull List<Cookie> cookieList) {
|
||||
Log.d("Skolplattformen", "Saving cookies!");
|
||||
if(cookieList != null) {
|
||||
for (Cookie c : cookieList) {
|
||||
cookies.put(c.name(), c);
|
||||
}
|
||||
Log.d("Skolplattformen", "Saved cookies! ("+ cookieList.size() +")");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -416,12 +416,7 @@ export class ApiHjarntorget extends EventEmitter implements Api {
|
|||
console.log("start bankid sign in")
|
||||
// We may get redirected to some other subdomain i.e. not 'm00-mg-local':
|
||||
// https://mNN-mg-local.idp.funktionstjanster.se/mg-local/auth/ccp11/grp/other
|
||||
console.log("waiting abit so next call doesn't redirect back to 'other' instead of 'verify'")
|
||||
// Need a short wait otherwise we end up in the wrong place!
|
||||
const waitabit = new Promise((resolve) => {
|
||||
setTimeout(() => resolve('foo'), 500)
|
||||
});
|
||||
await waitabit
|
||||
|
||||
console.log("done waiting....")
|
||||
const ssnBody = new URLSearchParams({ ssn: personalNumber }).toString()
|
||||
const beginBankIdResponse = await this.fetch('start-bankId', beginBankIdUrl((mvghostResponse as any).url), {
|
||||
|
@ -446,7 +441,7 @@ export class ApiHjarntorget extends EventEmitter implements Api {
|
|||
statusChecker.on('ERROR', () => {
|
||||
this.personalNumber = undefined
|
||||
})
|
||||
|
||||
|
||||
return statusChecker
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue