Page MenuHomePhorge

D11141.1765313267.diff
No OneTemporary

Size
5 KB
Referenced Files
None
Subscribers
None

D11141.1765313267.diff

diff --git a/lib/reducers/services-access-token-reducer.js b/lib/reducers/services-access-token-reducer.js
--- a/lib/reducers/services-access-token-reducer.js
+++ b/lib/reducers/services-access-token-reducer.js
@@ -3,6 +3,7 @@
import {
logOutActionTypes,
setAccessTokenActionType,
+ identityLogInActionTypes,
identityRegisterActionTypes,
} from '../actions/user-actions.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -25,7 +26,10 @@
return null;
} else if (action.type === logOutActionTypes.started) {
return null;
- } else if (action.type === identityRegisterActionTypes.success) {
+ } else if (
+ action.type === identityLogInActionTypes.success ||
+ action.type === identityRegisterActionTypes.success
+ ) {
return action.payload.accessToken;
}
return state;
diff --git a/lib/utils/services-utils.js b/lib/utils/services-utils.js
--- a/lib/utils/services-utils.js
+++ b/lib/utils/services-utils.js
@@ -7,7 +7,7 @@
// If this is true then we're using the identity service for auth. After we
// auth, the identity service gives us a CSAT, which we can use to auth with
// other Comm services.
-const usingCommServicesAccessToken = false;
+const usingCommServicesAccessToken = true;
// If this is true, then the app is able to support multiple keyservers. This
// requires the use of Tunnelbroker and the backup service to persist and sync
diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js
--- a/native/account/log-in-panel.react.js
+++ b/native/account/log-in-panel.react.js
@@ -30,6 +30,7 @@
} from 'lib/types/account-types.js';
import type { IdentityAuthResult } from 'lib/types/identity-service-types.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
+import { getContentSigningKey } from 'lib/utils/crypto-utils.js';
import {
useDispatchActionPromise,
type DispatchActionPromise,
@@ -45,6 +46,7 @@
import PasswordInput from './password-input.react.js';
import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
import SWMansionIcon from '../components/swmansion-icon.react.js';
+import { commCoreModule } from '../native-modules.js';
import { useSelector } from '../redux/redux-utils.js';
import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js';
import type { KeyPressEvent } from '../types/react-native.js';
@@ -322,6 +324,13 @@
username: this.usernameInputText,
password: this.passwordInputText,
});
+
+ const ed25519 = await getContentSigningKey();
+ await commCoreModule.setCommServicesAuthMetadata(
+ result.userID,
+ ed25519,
+ result.accessToken,
+ );
return result;
} catch (e) {
if (e.message === 'user not found') {
diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js
--- a/native/account/registration/registration-server-call.js
+++ b/native/account/registration/registration-server-call.js
@@ -11,6 +11,7 @@
} from 'lib/actions/user-actions.js';
import type { LogInStartingPayload } from 'lib/types/account-types.js';
import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js';
+import { getContentSigningKey } from 'lib/utils/crypto-utils.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
@@ -25,6 +26,7 @@
useNativeSetUserAvatar,
useUploadSelectedMedia,
} from '../../avatars/avatar-hooks.js';
+import { commCoreModule } from '../../native-modules.js';
import { useSelector } from '../../redux/redux-utils.js';
import { nativeLogInExtraInfoSelector } from '../../selectors/account-selectors.js';
import {
@@ -85,6 +87,14 @@
username: accountSelection.username,
password: accountSelection.password,
});
+
+ const ed25519 = await getContentSigningKey();
+ await commCoreModule.setCommServicesAuthMetadata(
+ result.userID,
+ ed25519,
+ result.accessToken,
+ );
+
return result;
} catch (e) {
if (e.message === 'username reserved') {
diff --git a/web/redux/action-types.js b/web/redux/action-types.js
--- a/web/redux/action-types.js
+++ b/web/redux/action-types.js
@@ -45,18 +45,6 @@
const threadKeyserverID = thread ? extractKeyserverIDFromID(thread) : null;
for (const keyserverID of allKeyserverIDs) {
- // As of Nov 2023, the only validation we have for adding a new keyserver
- // is we check if the keyserver URL is valid. This is not a very
- // extensive check, and gives the user the feeling of a false sucesses
- // when they add new keyservers to the keyserver store. ENG-5371 tracks
- // the task for initialzing a proper connection with the newly added
- // keyserver, and at that point we can make the validation checks
- // for adding a new keyserver more extensive. However, for the time being
- // we need to add this check below so that we aren't trying to make calls
- // to nonexistant keyservers that are in our keyserver store.
- if (keyserverID !== authoritativeKeyserverID) {
- continue;
- }
const clientUpdatesCurrentAsOf = allUpdatesCurrentAsOf[keyserverID];
const keyserverExcludedData: ExcludedData = {
threadStore: !!excludedData.threadStore && !!clientUpdatesCurrentAsOf,

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 9, 8:47 PM (13 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5857746
Default Alt Text
D11141.1765313267.diff (5 KB)

Event Timeline