These params should never be null, actually
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
cbd06926f3
commit
674ffed6a5
|
@ -214,7 +214,7 @@ export const logOut = () =>
|
||||||
const params = {
|
const params = {
|
||||||
client_id: state.auth.app.client_id!,
|
client_id: state.auth.app.client_id!,
|
||||||
client_secret: state.auth.app.client_secret!,
|
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))
|
return dispatch(revokeOAuthToken(params))
|
||||||
|
@ -245,7 +245,7 @@ export const fetchOwnAccounts = () =>
|
||||||
return state.auth.users.forEach((user) => {
|
return state.auth.users.forEach((user) => {
|
||||||
const account = state.accounts.get(user.id);
|
const account = state.accounts.get(user.id);
|
||||||
if (!account) {
|
if (!account) {
|
||||||
dispatch(verifyCredentials(user.access_token!, user.url!));
|
dispatch(verifyCredentials(user.access_token, user.url));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -75,7 +75,7 @@ const AuthTokenList: React.FC = () => {
|
||||||
const currentTokenId = useAppSelector(state => {
|
const currentTokenId = useAppSelector(state => {
|
||||||
const currentToken = state.auth.tokens.valueSeq().find((token) => token.me === state.auth.me);
|
const currentToken = state.auth.tokens.valueSeq().find((token) => token.me === state.auth.me);
|
||||||
|
|
||||||
return currentToken?.get('id');
|
return currentToken?.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -34,21 +34,21 @@ export const AuthAppRecord = ImmutableRecord({
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AuthTokenRecord = ImmutableRecord({
|
export const AuthTokenRecord = ImmutableRecord({
|
||||||
access_token: null as string | null,
|
access_token: '',
|
||||||
account: null as string | null,
|
account: null as string | null,
|
||||||
created_at: null as number | null,
|
created_at: 0,
|
||||||
expires_in: null as number | null,
|
expires_in: null as number | null,
|
||||||
id: null as number | null,
|
id: null as number | null,
|
||||||
me: null as string | null,
|
me: null as string | null,
|
||||||
refresh_token: null as string | null,
|
refresh_token: null as string | null,
|
||||||
scope: null as string | null,
|
scope: '',
|
||||||
token_type: null as string | null,
|
token_type: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AuthUserRecord = ImmutableRecord({
|
export const AuthUserRecord = ImmutableRecord({
|
||||||
access_token: null as string | null,
|
access_token: '',
|
||||||
id: null as string | null,
|
id: '',
|
||||||
url: null as string | null,
|
url: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ReducerRecord = ImmutableRecord({
|
export const ReducerRecord = ImmutableRecord({
|
||||||
|
|
|
@ -273,8 +273,8 @@ const getAuthUserIds = createSelector([
|
||||||
], authUsers => {
|
], authUsers => {
|
||||||
return authUsers.reduce((ids: ImmutableOrderedSet<string>, authUser) => {
|
return authUsers.reduce((ids: ImmutableOrderedSet<string>, authUser) => {
|
||||||
try {
|
try {
|
||||||
const id = authUser.get('id');
|
const id = authUser.id;
|
||||||
return validId(id) ? ids.add(id!) : ids;
|
return validId(id) ? ids.add(id) : ids;
|
||||||
} catch {
|
} catch {
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue