Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1st request to endpoint
- REQUEST[POST] => PATH: https://PATH-TO-ORIGINAL-REQUEST | DATA => {} | JWT => {Content-type: application/json, Authorization: Bearer MY-EXPIRED-TOKEN}
- //jwt expired, call to refresh endpoint
- REQUEST[POST] => PATH: https://PATH-TO-REFRESH-TOKEN | DATA => {refresh_token: REFRESH-TOKEN, grant_type: refresh_token} | JWT => {Content-type: application/json, Authorization: Bearer TOKEN}
- //successful refresh
- RESPONSE[200] => PATH: https://PATH-TO-REFRESH-TOKEN | DATA => {access_token: NEW-JWT-TOKEN, response_message: success_default}
- //2nd request to original endpoint
- REQUEST[POST] => PATH: https://PATH-TO-ORIGINAL-REQUEST | DATA => {} | JWT => {Content-type: application/json, Authorization: Bearer NEW-JWT-TOKEN}
- //successful response
- RESPONSE[200] => PATH: https://PATH-TO-ORIGINAL-REQUEST | DATA => { RESPONSE DATA}
- //error response
- ERROR[401] => PATH: https://PATH-TO-ORIGINAL-REQUEST | SENT_DATA => {} | RECEIVED_DATA => {response_message: autenticator_errors_invalid_token_expired}
- Error: Bad state: Future already completed
- at Object.throw_ [as throw] (http://localhost:50182/dart_sdk.js:5405:11)
- at _AsyncCompleter.new.completeError (http://localhost:50182/dart_sdk.js:37318:62)
- at dio_mixin.ErrorInterceptorHandler.new.next (http://localhost:50182/packages/dio/src/interceptors/log.dart.lib.js:2138:24)
- at custom_interceptors.CustomInterceptor.new.onError (http://localhost:50182/packages/dio/src/interceptors/log.dart.lib.js:458:22)
- at [onError] (http://localhost:50182/packages/flutterApp/repository/dio/custom_interceptors.dart.lib.js:65:20)
- at custom_interceptors.CustomInterceptor.new.onError$ (http://localhost:50182/packages/flutterApp/repository/dio/custom_interceptors.dart.lib.js:55:29)
- at onError$.next (<anonymous>)
- at runBody (http://localhost:50182/dart_sdk.js:43083:34)
- at Object._async [as async] (http://localhost:50182/dart_sdk.js:43114:7)
- at custom_interceptors.CustomInterceptor.new.onError (http://localhost:50182/packages/flutterApp/repository/dio/custom_interceptors.dart.lib.js:52:20)
- at [onError] (http://localhost:50182/packages/flutterApp/repository/dio/custom_interceptors.dart.lib.js:137:20)
- at custom_interceptors.CustomInterceptor.new.onError (http://localhost:50182/packages/flutterApp/repository/dio/custom_interceptors.dart.lib.js:117:34)
- at onError.next (<anonymous>)
- at http://localhost:50182/dart_sdk.js:43063:33
- at _RootZone.runUnary (http://localhost:50182/dart_sdk.js:42919:58)
- at _FutureListener.thenAwait.handleValue (http://localhost:50182/dart_sdk.js:37493:29)
- at handleValueCallback (http://localhost:50182/dart_sdk.js:38088:49)
- at _Future._propagateToListeners (http://localhost:50182/dart_sdk.js:38126:17)
- at [_complete] (http://localhost:50182/dart_sdk.js:37947:25)
- at _SyncCompleter.new.complete (http://localhost:50182/dart_sdk.js:37401:31)
- at onValue (http://localhost:50182/dart_sdk.js:37154:60)
- at _RootZone.runUnary (http://localhost:50182/dart_sdk.js:42919:58)
- at _FutureListener.then.handleValue (http://localhost:50182/dart_sdk.js:37493:29)
- at handleValueCallback (http://localhost:50182/dart_sdk.js:38088:49)
- at _Future._propagateToListeners (http://localhost:50182/dart_sdk.js:38126:17)
- at [_completeWithValue] (http://localhost:50182/dart_sdk.js:37955:23)
- at async._AsyncCallbackEntry.new.callback (http://localhost:50182/dart_sdk.js:37991:35)
- at Object._microtaskLoop (http://localhost:50182/dart_sdk.js:43223:13)
- at _startMicrotaskLoop (http://localhost:50182/dart_sdk.js:43229:13)
- at http://localhost:50182/dart_sdk.js:38359:9
- new page initState successful request + response
- REQUEST[POST] => PATH: https://FURTHER-REQUEST | DATA => {} | JWT => {Content-type: application/json, Authorization: Bearer NEW-JWT-TOKEN}
- RESPONSE[200] => PATH: https://FURTHER-REQUEST | DATA => { SUCCESSFUL RESPONSE BODY
Advertisement
Add Comment
Please, Sign In to add comment