diff --git a/app/soapbox/actions/auth.ts b/app/soapbox/actions/auth.ts index df5f47f16b..436c87ff29 100644 --- a/app/soapbox/actions/auth.ts +++ b/app/soapbox/actions/auth.ts @@ -214,7 +214,7 @@ export const logOut = () => const params = { client_id: state.auth.app.client_id!, client_secret: state.auth.app.client_secret!, - token: state.auth.users.get(account.url)?.access_token!, + token: state.auth.users.get(account.url)!.access_token, }; return dispatch(revokeOAuthToken(params)) @@ -245,7 +245,7 @@ export const fetchOwnAccounts = () => return state.auth.users.forEach((user) => { const account = state.accounts.get(user.id); if (!account) { - dispatch(verifyCredentials(user.access_token!, user.url!)); + dispatch(verifyCredentials(user.access_token, user.url)); } }); }; diff --git a/app/soapbox/features/auth-token-list/index.tsx b/app/soapbox/features/auth-token-list/index.tsx index c7830310fc..360c05a479 100644 --- a/app/soapbox/features/auth-token-list/index.tsx +++ b/app/soapbox/features/auth-token-list/index.tsx @@ -75,7 +75,7 @@ const AuthTokenList: React.FC = () => { const currentTokenId = useAppSelector(state => { const currentToken = state.auth.tokens.valueSeq().find((token) => token.me === state.auth.me); - return currentToken?.get('id'); + return currentToken?.id; }); useEffect(() => { diff --git a/app/soapbox/reducers/auth.ts b/app/soapbox/reducers/auth.ts index 47aadcb0a8..85b8159b40 100644 --- a/app/soapbox/reducers/auth.ts +++ b/app/soapbox/reducers/auth.ts @@ -34,21 +34,21 @@ export const AuthAppRecord = ImmutableRecord({ }); export const AuthTokenRecord = ImmutableRecord({ - access_token: null as string | null, + access_token: '', account: null as string | null, - created_at: null as number | null, + created_at: 0, expires_in: null as number | null, id: null as number | null, me: null as string | null, refresh_token: null as string | null, - scope: null as string | null, - token_type: null as string | null, + scope: '', + token_type: '', }); export const AuthUserRecord = ImmutableRecord({ - access_token: null as string | null, - id: null as string | null, - url: null as string | null, + access_token: '', + id: '', + url: '', }); export const ReducerRecord = ImmutableRecord({ diff --git a/app/soapbox/selectors/index.ts b/app/soapbox/selectors/index.ts index 77a64a2128..b8303c0dbe 100644 --- a/app/soapbox/selectors/index.ts +++ b/app/soapbox/selectors/index.ts @@ -273,8 +273,8 @@ const getAuthUserIds = createSelector([ ], authUsers => { return authUsers.reduce((ids: ImmutableOrderedSet, authUser) => { try { - const id = authUser.get('id'); - return validId(id) ? ids.add(id!) : ids; + const id = authUser.id; + return validId(id) ? ids.add(id) : ids; } catch { return ids; }