TDevUIT / PirateSocial

Make awesome things! We connect a public who have a pirate mind to do pirate things.
0 stars 1 forks source link

setup auth context store #22

Open vanthaita opened 1 week ago

vanthaita commented 1 week ago

Summary:

Implement real-time messaging using socket communication to call APIs from the server and display responses in the chat window without modifying the source code.

Scope:

This feature pertains to the chat application, specifically handling the integration of socket-based messaging and API interactions to update the chat interface in real-time.

Detail:

When a user initiates a contract listing, create a chat room for that contract. Ensure that socket communication is established so that any messages related to the contract are sent to and received from this chat room.

Additionally, set up an authentication context store to manage user authentication details. This includes:

Access Token: Store and manage the user's access token for authenticated API requests. Refresh Token: Handle the refresh token to obtain new access tokens when the current one expires. User Profile: Store and manage user profile information for personalized interactions within the chat application. The authentication context should provide the following functionalities:

Access and Refresh Tokens: Ensure tokens are stored securely and used for API requests. Implement logic to refresh tokens automatically when needed. User Profile: Load and update the user profile data as required by the chat application. Checklist: