Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3349617
D9114.id31075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9114.id31075.diff
View Options
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -322,6 +322,8 @@
const resetUserStateActionType = 'RESET_USER_STATE';
+const setAccessTokenActionType = 'SET_ACCESS_TOKEN';
+
export {
changeUserPasswordActionTypes,
changeUserPassword,
@@ -350,4 +352,5 @@
updateUserAvatarActionTypes,
updateUserAvatar,
resetUserStateActionType,
+ setAccessTokenActionType,
};
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
@@ -1,11 +1,9 @@
// @flow
-import { siweAuthActionTypes } from '../actions/siwe-actions.js';
import {
logOutActionTypes,
deleteAccountActionTypes,
- logInActionTypes,
- registerActionTypes,
+ setAccessTokenActionType,
} from '../actions/user-actions.js';
import type { BaseAction } from '../types/redux-types.js';
import { setNewSessionActionType } from '../utils/action-utils.js';
@@ -14,12 +12,8 @@
state: ?string,
action: BaseAction,
): ?string {
- if (
- action.type === logInActionTypes.success ||
- action.type === siweAuthActionTypes.success ||
- action.type === registerActionTypes.success
- ) {
- return null;
+ if (action.type === setAccessTokenActionType) {
+ return action.payload;
} else if (
action.type === setNewSessionActionType &&
action.payload.sessionChange.currentUserInfo &&
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
@@ -1190,6 +1190,10 @@
+error: true,
+payload: Error,
+loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'SET_ACCESS_TOKEN',
+ +payload: string,
};
export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 6:23 PM (19 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571239
Default Alt Text
D9114.id31075.diff (1 KB)
Attached To
Mode
D9114: [native] update action types and reducer for setting comm access token
Attached
Detach File
Event Timeline
Log In to Comment