Page MenuHomePhabricator

D6024.diff
No OneTemporary

D6024.diff

diff --git a/keyserver/src/endpoints.js b/keyserver/src/endpoints.js
--- a/keyserver/src/endpoints.js
+++ b/keyserver/src/endpoints.js
@@ -52,6 +52,7 @@
accountDeletionResponder,
accountCreationResponder,
logInResponder,
+ siweAuthResponder,
oldPasswordUpdateResponder,
updateUserSettingsResponder,
policyAcknowledgmentResponder,
@@ -234,6 +235,10 @@
responder: siweNonceResponder,
requiredPolicies: [],
},
+ siwe_auth: {
+ responder: siweAuthResponder,
+ requiredPolicies: [],
+ },
};
export { jsonEndpoints };
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
@@ -293,6 +293,10 @@
return response;
}
+async function siweAuthResponder(): Promise<string> {
+ return 'UNIMPLEMENTED';
+}
+
const updatePasswordRequestInputValidator = tShape({
code: t.String,
password: tPassword,
@@ -357,6 +361,7 @@
accountDeletionResponder,
accountCreationResponder,
logInResponder,
+ siweAuthResponder,
oldPasswordUpdateResponder,
updateUserSettingsResponder,
policyAcknowledgmentResponder,
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
@@ -14,4 +14,16 @@
return response.nonce;
};
-export { getSIWENonceActionTypes, getSIWENonce };
+const siweAuthActionTypes = Object.freeze({
+ started: 'SIWE_AUTH_STARTED',
+ success: 'SIWE_AUTH_SUCCESS',
+ failed: 'SIWE_AUTH_FAILED',
+});
+const siweAuth = (
+ callServerEndpoint: CallServerEndpoint,
+): (() => Promise<string>) => async () => {
+ const response = await callServerEndpoint('siwe_auth');
+ return response;
+};
+
+export { getSIWENonceActionTypes, getSIWENonce, siweAuthActionTypes, siweAuth };
diff --git a/lib/types/endpoints.js b/lib/types/endpoints.js
--- a/lib/types/endpoints.js
+++ b/lib/types/endpoints.js
@@ -81,6 +81,7 @@
UPDATE_USER_SUBSCRIPTION: 'update_user_subscription',
VERIFY_CODE: 'verify_code',
SIWE_NONCE: 'siwe_nonce',
+ SIWE_AUTH: 'siwe_auth',
});
type SocketPreferredEndpoint = $Values<typeof socketPreferredEndpoints>;
diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -893,6 +893,22 @@
+error: true,
+payload: Error,
+loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'SIWE_AUTH_STARTED',
+ +payload?: void,
+ +loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'SIWE_AUTH_SUCCESS',
+ +payload?: void,
+ +loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'SIWE_AUTH_FAILED',
+ +error: true,
+ +payload: Error,
+ +loadingInfo: LoadingInfo,
};
export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string);

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 5, 3:55 PM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2244493
Default Alt Text
D6024.diff (2 KB)

Event Timeline