Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3567908
D6026.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6026.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 9:42 PM (8 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2729187
Default Alt Text
D6026.diff (2 KB)
Attached To
Mode
D6026: [lib] Introduce `SIWEAuthServerCall` and use as argument for `siweAuth()`
Attached
Detach File
Event Timeline
Log In to Comment