adbahrani / MSGraphDashBoard

1 stars 3 forks source link

Add changes for nest movement and login signup page #25

Closed Mohit21GoJs closed 10 months ago

adbahrani commented 10 months ago

Looking promising! I'll do some more looking later on

One last thing we probably want to redirect from anything other than Home "route /" if not logged in to prevent auth errors

Mohit21GoJs commented 10 months ago

Looking promising! I'll do some more looking later on

One last thing we probably want to redirect from anything other than Home "route /" if not logged in to prevent auth errors

Added a protected route and wrapped most components in them with context for auth

Mohit21GoJs commented 10 months ago

@adbahrani I found a bug while testing a logged in session overnight, i think the refresh token was not happening on client side because we refresh token when our api gets called.

So the scenario where refresh token would not happen is call /users which directly calls msgaph api, to fix this issue.

I created:

One more advantage of this is, now client side do not need to expose the token in requests.

But this is a sub-optimal approach as it makes hits on our server, especially in parallel call cases.

The long term approach i can suggest is to move all the client/services in backend and move all logic in backend

That would improve performance and makes the app scalable :)