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,8 +3,8 @@ import { logOutActionTypes, setAccessTokenActionType, - identityRegisterActionTypes, identityLogInActionTypes, + identityRegisterActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { BaseAction } from '../types/redux-types.js'; 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 @@ -13,6 +13,7 @@ import { FIDContext } from 'lib/components/fid-provider.react.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'; @@ -27,6 +28,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 { @@ -95,6 +97,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,