You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to establish subscription, we are using the amplify-js package in our react application as given below. We are passing our AuthToken directly here, We don't have a direct login screen, we just get the auth token through different mechanism. But, when we pass authToken directly, we don't have any mechanism to refresh the token, when it got expired, let's say after an hour. It will be helpful, if we get some call back mechanism, where we can pass a method to get a new token when token is expired.
API.graphql( graphqlOperation(subscriptions.NotificationMutaion, variables, authToken)).subscribe({ next :({_, value}) => { // Our business logic here } , error : (error) => console.log(error) });
Describe the solution you'd like
A provision to supply call back method, which can be called to get the latest token.
Describe alternatives you've considered
We are disconnecting all the subscriptions and connecting back when token is expired and we get unauthorized from subscription.
Additional context
No response
Is this something that you'd be interested in working on?
👋 I may be able to implement this feature request
⚠️ This feature might incur a breaking change
The text was updated successfully, but these errors were encountered:
Is this related to a new or existing framework?
React
Is this related to a new or existing API?
GraphQL API
Is this related to another service?
No response
Describe the feature you'd like to request
In order to establish subscription, we are using the amplify-js package in our react application as given below. We are passing our AuthToken directly here, We don't have a direct login screen, we just get the auth token through different mechanism. But, when we pass authToken directly, we don't have any mechanism to refresh the token, when it got expired, let's say after an hour. It will be helpful, if we get some call back mechanism, where we can pass a method to get a new token when token is expired.
API.graphql( graphqlOperation(subscriptions.NotificationMutaion, variables, authToken)).subscribe({ next :({_, value}) => { // Our business logic here } , error : (error) => console.log(error) });
Describe the solution you'd like
A provision to supply call back method, which can be called to get the latest token.
Describe alternatives you've considered
We are disconnecting all the subscriptions and connecting back when token is expired and we get unauthorized from subscription.
Additional context
No response
Is this something that you'd be interested in working on?
The text was updated successfully, but these errors were encountered: