Page MenuHomePhabricator

D6026.id20128.diff
No OneTemporary

D6026.id20128.diff

diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js
--- a/keyserver/src/responders/user-responders.js
+++ b/keyserver/src/responders/user-responders.js
@@ -302,10 +302,10 @@
watchedIDs: t.list(t.String),
});
-async function siweAuthResponder(viewer: Viewer, input: any): Promise<string> {
+async function siweAuthResponder(viewer: Viewer, input: any): Promise<boolean> {
await validateInput(viewer, siweAuthRequestInputValidator, input);
- return 'UNIMPLEMENTED';
+ return false;
}
const updatePasswordRequestInputValidator = tShape({
diff --git a/lib/actions/siwe-actions.js b/lib/actions/siwe-actions.js
--- a/lib/actions/siwe-actions.js
+++ b/lib/actions/siwe-actions.js
@@ -1,6 +1,9 @@
// @flow
+import threadWatcher from '../shared/thread-watcher.js';
+import type { SIWEAuthServerCall } from '../types/siwe-types.js';
import type { CallServerEndpoint } from '../utils/call-server-endpoint';
+import { getConfig } from '../utils/config.js';
const getSIWENonceActionTypes = Object.freeze({
started: 'GET_SIWE_NONCE_STARTED',
@@ -19,10 +22,22 @@
success: 'SIWE_AUTH_SUCCESS',
failed: 'SIWE_AUTH_FAILED',
});
+const siweAuthCallServerEndpointOptions = { timeout: 60000 };
const siweAuth = (
callServerEndpoint: CallServerEndpoint,
-): (() => Promise<string>) => async () => {
- const response = await callServerEndpoint('siwe_auth');
+): ((
+ siweAuthPayload: SIWEAuthServerCall,
+) => Promise<boolean>) => async siweAuthPayload => {
+ const watchedIDs = threadWatcher.getWatchedIDs();
+ const response = await callServerEndpoint(
+ 'siwe_auth',
+ {
+ ...siweAuthPayload,
+ watchedIDs,
+ platformDetails: getConfig().platformDetails,
+ },
+ siweAuthCallServerEndpointOptions,
+ );
return response;
};
diff --git a/lib/types/siwe-types.js b/lib/types/siwe-types.js
--- a/lib/types/siwe-types.js
+++ b/lib/types/siwe-types.js
@@ -1,5 +1,6 @@
// @flow
+import type { LogInExtraInfo } from './account-types.js';
import {
type DeviceTokenUpdateRequest,
type PlatformDetails,
@@ -19,6 +20,12 @@
+watchedIDs: $ReadOnlyArray<string>,
};
+export type SIWEAuthServerCall = {
+ +message: string,
+ +signature: string,
+ ...LogInExtraInfo,
+};
+
// This is a message that the rendered webpage (landing/siwe.react.js) uses to
// communicate back to the React Native WebView that is rendering it
// (native/account/siwe-panel.react.js)

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 29, 12:46 PM (8 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2729187
Default Alt Text
D6026.id20128.diff (2 KB)

Event Timeline