Replies: 3 comments
-
Also the strategy you used for refreshing tokens is great. It didn't internally rely on axios or any data fetching api. |
Beta Was this translation helpful? Give feedback.
-
Hey @prince272 , Thanks for appreciating the project this much, and sorry for being this late. But the problem with the current implementation is that it relies on React for state management. I don't have much clear idea of how to maintain the state without using React If you have any idea, let me know. Let's start the discussion and let's build this together. |
Beta Was this translation helpful? Give feedback.
-
First of all, let me express my gratitude for your reply. My Research after posting this issue: I did some research and discovered several approaches for managing the tokens using axois and also discovered a way to support both client and server-side, After that, I wrote my own custom solution at https://github.com/prince272/CleanArchitecture/blob/master/src/CleanArchitecture.Client/utils/axios.js which uses BehaviorSubject for rasing the user changed event and for containing the user object as well, and cookies for storing the tokens and user object too. Usage: https://github.com/prince272/CleanArchitecture/blob/master/src/CleanArchitecture.Client/client.js Your solution: You can maintain the state using a dependency library: Also, you can review my current solution at https://github.com/prince272/CleanArchitecture/tree/master/src/CleanArchitecture.Client |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Have you considered adding auth-kit.js without any react dependencies so that it could be used on most platform.
I thing the three issues that may ender the approach of developing the auth-kit are:
Describe the solution you'd like
With auth-kit, there should be no need for statement. Replace it with event that passes the current state of the token object.
eg: new AuthProvider ({authType: 'cookie' authName: '_auth', cookieDomain: window.location.hostname, cookieSecure: window.location.protocol === "https:")
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
If you'd like me to work on the auth-kit of the react-auth-kit version. I'd be very happy. Also, the little problem is that I only know JavaScript and not typescript. But we'd work things out.
Beta Was this translation helpful? Give feedback.
All reactions