Skip to content

Commit fa54555

Browse files
committed
throw error when selecting pocket app
1 parent 0fe0294 commit fa54555

File tree

6 files changed

+31
-22
lines changed

6 files changed

+31
-22
lines changed

dist/login/twoFAMethodRequest.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/login/twoFAMethodRequest.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/questions.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/questions.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/login/twoFAMethodRequest.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import { gFetch } from "../cookieJar";
2-
import { LoginData } from "../types";
3-
import getVerificationToken from "./getVerificationToken";
1+
import { gFetch } from '../cookieJar'
2+
import { LoginData } from '../types'
3+
import getVerificationToken from './getVerificationToken'
44

55
async function twoFAMethodRequest(data: LoginData) {
6-
let { twoFaLocation, method } = data;
7-
if (method === "sms") {
8-
const toReplace = twoFaLocation!.includes("AOLSmartphone")
9-
? "AOLSmartphone"
10-
: "Smartphone";
11-
twoFaLocation = twoFaLocation!.replace(toReplace, "Sms");
6+
let { twoFaLocation, method } = data
7+
if (method === 'sms') {
8+
const toReplace = twoFaLocation!.includes('AOLSmartphone')
9+
? 'AOLSmartphone'
10+
: 'Smartphone'
11+
twoFaLocation = twoFaLocation!.replace(toReplace, 'Sms')
1212
}
13-
14-
const sendsmsResponse = await gFetch(twoFaLocation!);
15-
const tokens = await getVerificationToken(sendsmsResponse);
16-
return { ...data, ...tokens };
13+
const sendsmsResponse = await gFetch(twoFaLocation!)
14+
const tokens = await getVerificationToken(sendsmsResponse)
15+
return { ...data, ...tokens }
1716
}
1817

19-
export default twoFAMethodRequest;
18+
export default twoFAMethodRequest

src/questions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export const askLoginQuestions = async (data: LoginData) => {
2929
loop: false,
3030
},
3131
])
32+
// for now , dont support pocket app
33+
if (answers.method !== 'sms') {
34+
throw new Error('not supported yet')
35+
}
3236
return { ...data, ...answers }
3337
}
3438

0 commit comments

Comments
 (0)