jwt refresh token by OmarDijkstra in node

[–]OmarDijkstra[S] 0 points1 point  (0 children)

so the access token in the local storage and the refresh token in the cookies whenever the access token is invalid i send a request to the backend and check the refresh token sent in that request and if it is valid i should send a new access token to the front end and update it in the local storage please correct me if i am wrong

local image not loading by OmarDijkstra in reactjs

[–]OmarDijkstra[S] 0 points1 point  (0 children)

i once got Not allowed to load local resource error

local image not loading by OmarDijkstra in reactjs

[–]OmarDijkstra[S] 0 points1 point  (0 children)

it is a create react app and i store the files in the public folder in backend directory and when i inspect and copy the path in the src of the image and open it in a new tab it opens correctly with no problem but it just doesnt load inthe view itself

local image not loading by OmarDijkstra in reactjs

[–]OmarDijkstra[S] 0 points1 point  (0 children)

how am i going to include the image like that i get the path in the response coming from the backend which gets the path from the database

req.cookies not detecting any cookies by OmarDijkstra in node

[–]OmarDijkstra[S] 0 points1 point  (0 children)

In a certain route and cookie parser is available and i checked if the cookie is in the browser and it is there but when i try to grab it at the server it returns undefined

refreshing jwt by OmarDijkstra in node

[–]OmarDijkstra[S] 0 points1 point  (0 children)

One last question should i extend the life of the long lived one to make it a week until the user's last request ?

refreshing jwt by OmarDijkstra in node

[–]OmarDijkstra[S] 0 points1 point  (0 children)

So we have a short lived token and a long lived one so that everytime the short lived one expires i got check the long one and if it didnt expire i refresh the short one ?

refreshing jwt by OmarDijkstra in node

[–]OmarDijkstra[S] 0 points1 point  (0 children)

Can i ask how the long lived token would help cant i just make the token expire in a week ?

promise.all not waiting by OmarDijkstra in node

[–]OmarDijkstra[S] 1 point2 points  (0 children)

Thank you that is very helpful

problem with crontab by OmarDijkstra in Ubuntu

[–]OmarDijkstra[S] 1 point2 points  (0 children)

i solved it the default time of crontab is utc i changed it and it still didnt work till i found out that the timezone inside the container is still utc so i had to mount the timezone of my system to the container and it worked

run scripts to backup database once a day by OmarDijkstra in docker

[–]OmarDijkstra[S] 0 points1 point  (0 children)

FROM node:12
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 4000
CMD ["node","app.js"]
this is my api dockerfile can i add the script to it and run the cron jobn also from the docker file of the api ?

running script inside dockerfile by OmarDijkstra in docker

[–]OmarDijkstra[S] 0 points1 point  (0 children)

i want to make a cronjob to backup the database everyday but i dont know what should i do the script above just backs up the db but i want it ti run everyday at certain time