Skip to content

Commit

Permalink
feat(status): incorecct password
Browse files Browse the repository at this point in the history
  • Loading branch information
EdamAme-x committed Jan 20, 2024
1 parent 6f31187 commit 0db3f28
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
9 changes: 9 additions & 0 deletions deno_dist/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ export class PayPay {
return this.createLoginResult(true, 'LoginSuccess')
} else {
if (result['response_type'] === 'ErrorResponse') {

if ('result_info' in result) {
if ('result_code' in result['result_info']) {
if (result['result_info']['result_code'] === 'INTERNAL_AUTH_INVALID_GRANT_ERROR') {
return this.createLoginResult(false, 'LoginIncorrectPassword')
}
}
}

return this.createLoginResult(false, 'LoginFailed')
} else {
this.otp = {
Expand Down
1 change: 1 addition & 0 deletions deno_dist/status/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const PayPayStatus = {
LoginSuccess: 'LoginSuccess',
LoginFailed: 'LoginFailed',
LoginIncorrectPassword: 'LoginIncorrectPassword',
LoginNeedOTP: 'LoginNeedOTP',
LoginDontNeedOTP: 'LoginDontNeedOTP',
OTPLoginSuccess: 'OTPLoginSuccess',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paypax",
"version": "1.7.3",
"version": "1.7.4",
"description": "Library for automate PayPay operations",
"scripts": {
"format": "prettier --write ./src/*.{ts,tsx} ./src/**/*.{ts,tsx}",
Expand Down
9 changes: 9 additions & 0 deletions src/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ export class PayPay {
return this.createLoginResult(true, 'LoginSuccess')
} else {
if (result['response_type'] === 'ErrorResponse') {

if ('result_info' in result) {
if ('result_code' in result['result_info']) {
if (result['result_info']['result_code'] === 'INTERNAL_AUTH_INVALID_GRANT_ERROR') {
return this.createLoginResult(false, 'LoginIncorrectPassword')
}
}
}

return this.createLoginResult(false, 'LoginFailed')
} else {
this.otp = {
Expand Down
1 change: 1 addition & 0 deletions src/status/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const PayPayStatus = {
LoginSuccess: 'LoginSuccess',
LoginFailed: 'LoginFailed',
LoginIncorrectPassword: 'LoginIncorrectPassword',
LoginNeedOTP: 'LoginNeedOTP',
LoginDontNeedOTP: 'LoginDontNeedOTP',
OTPLoginSuccess: 'OTPLoginSuccess',
Expand Down

0 comments on commit 0db3f28

Please sign in to comment.