У меня есть проектact-redux-firebase, использующий аутентификацию. У меня была проблема с тем, что пользователи не оставались в системе через некоторое время, прежде чем осознали, что консоль была полна ошибок ответа POST. Я проверил запрос на вкладке сети devtools и обнаружил, что я получаю ошибку 403 от автоматического отправляемого запроса refresh_token.
Понятия не имею, почему это может происходить.
index.js
import './index.scss';
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter as Router } from "react-router-dom";
import { createStore, applyMiddleware } from 'redux';
import { root_reducer } from './store/reducers/root_reducer';
import { Provider } from 'react-redux';
import { composeWithDevTools } from "redux-devtools-extension";
import thunk from 'redux-thunk';
import { reduxFirestore, getFirestore } from 'redux-firestore';
import { reactReduxFirebase, getFirebase } from 'react-redux-firebase';
import { app } from './config/fb_config';
import { App } from './App';
const store = createStore(root_reducer,
composeWithDevTools(
applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore })),
reduxFirestore(app),
reactReduxFirebase(app, { attachAuthIsReady: true })
)
);
store.firebaseAuthIsReady.then(_ => {
ReactDOM.render(
<Provider store={store}>
<Router>
<App />
</Router>
</Provider>,
document.getElementById('root')
);
});
зависимости
"dependencies": {
"@material-ui/core": "^3.9.2",
"@material-ui/icons": "^3.0.2",
"express": "^4.16.4",
"firebase": "^5.9.1",
"material-ui-next-pickers": "^0.0.20",
"mui-datatables": "^2.0.0-beta.59",
"prop-types": "^15.7.2",
"react": "^16.8.3",
"react-currency-input": "^1.3.6",
"react-dom": "^16.8.3",
"react-redux": "^5.1.1",
"react-redux-firebase": "^2.2.6",
"react-router-dom": "^4.3.1",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.8",
"redux-firestore": "^0.7.2",
"redux-thunk": "^2.3.0",
"reload": "^2.4.0",
"watch": "^1.0.2"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.3",
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"@firebase/app-types": "^0.3.7",
"babel-loader": "^8.0.5",
"concurrently": "^4.1.0",
"css-loader": "^2.1.0",
"node-sass": "^4.11.0",
"nodemon": "^1.18.10",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3"
}