Skip to content

Commit 237e651

Browse files
committed
fix: match ring app 2fa headers
1 parent b567be7 commit 237e651

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

api/rest-client.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,7 @@ export class RingRestClient {
101101
private async getAuthToken(
102102
twoFactorAuthCode?: string
103103
): Promise<AuthTokenResponse> {
104-
const grantData = this.getGrantData(twoFactorAuthCode),
105-
twoFactorAuthHeaders = twoFactorAuthCode
106-
? {
107-
'2fa-code': twoFactorAuthCode,
108-
'2fa-Support': 'true'
109-
}
110-
: {}
104+
const grantData = this.getGrantData(twoFactorAuthCode)
111105

112106
try {
113107
const response = await requestWithRetry<AuthTokenResponse>({
@@ -120,7 +114,8 @@ export class RingRestClient {
120114
method: 'POST',
121115
headers: {
122116
'content-type': 'application/json',
123-
...twoFactorAuthHeaders
117+
'2fa-support': 'true',
118+
'2fa-code': twoFactorAuthCode || ''
124119
}
125120
})
126121

0 commit comments

Comments
 (0)