mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-23 15:29:07 +00:00
[Glitch] Remove the access token from Redux & context
Port 2c5ab8f647 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import { layoutFromWindow } from 'flavours/glitch/is_mobile';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
streaming_api_base_url: null,
|
||||
access_token: null,
|
||||
layout: layoutFromWindow(),
|
||||
permissions: '0',
|
||||
});
|
||||
@@ -14,7 +13,8 @@ const initialState = ImmutableMap({
|
||||
export default function meta(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case STORE_HYDRATE:
|
||||
return state.merge(action.state.get('meta')).set('permissions', action.state.getIn(['role', 'permissions']));
|
||||
// we do not want `access_token` to be stored in the state
|
||||
return state.merge(action.state.get('meta')).delete('access_token').set('permissions', action.state.getIn(['role', 'permissions']));
|
||||
case changeLayout.type:
|
||||
return state.set('layout', action.payload.layout);
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user