Flask and React routing

Issue I’m building the Flask app with React, I ended up having a problem with routing. The backend is responsible to be an API, hence some routes look like: @app.route(‘/api/v1/do-something/’, methods=[“GET”]) def do_something(): return something() and the main route which

Continue reading

How to highlight React tsx with PrismJS

Issue I have this html file: <!DOCTYPE html> <html> <head> <title>Test PrismJS</title> <meta charset="utf-8" /> <link rel="stylesheet" href="prism/prism-onedark.css"> </head> <body> <pre><code class="language-tsx"> // Display some tsx: <SocketProvider url={`ws://${apiServer}/…`}> <Stats /> </SocketProvider> </code></pre> <script type="text/javascript" src="prism/prism.js"></script> </body> </html> It is supposed

Continue reading

Logout from next-auth with keycloak provider not works

Issue I have a nextjs application with next-auth to manage the authentication. Here my configuration …. export default NextAuth({ // Configure one or more authentication providers providers: [ KeycloakProvider({ id: ‘my-keycloack-2’, name: ‘my-keycloack-2’, clientId: process.env.NEXTAUTH_CLIENT_ID, clientSecret: process.env.NEXTAUTH_CLIENT_SECRET, issuer: process.env.NEXTAUTH_CLIENT_ISSUER, profile:

Continue reading

NextJS SSR and Client side state

Issue I have the following nextJS app: export default function Home({ productsData }) { const [user, setUser] = useState(null); const [products, setProducts] = useState([]); useEffect(() => { if (productsData) setProducts(productsData); }, [productsData]); useEffect(() => { const userLocal = window.localStorage.getItem("user"); if

Continue reading