Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

405 method not allowed or block in login page #41

Open
3eme-oeil opened this issue Mar 10, 2023 · 1 comment
Open

405 method not allowed or block in login page #41

3eme-oeil opened this issue Mar 10, 2023 · 1 comment

Comments

@3eme-oeil
Copy link

3eme-oeil commented Mar 10, 2023

Hello,
My thingsboard server does not have a login page, and when I want to use it with flutter_thingsboard_pe_app it doesn’t work.
If I put a login page I stay blocked on this page, and when I use it without, I have the following error :

`I/flutter (19183): ERROR │ ThingsboardError: message: [Path '/dashboard/a5cadd50-a14e-11ed-87c2-c125db766c58': Method Not Allowed], errorCode: 2, status: 405

I/flutter (19183): ERROR │ #0 toThingsboardError (package:thingsboard_pe_client/src/error/_thingsboard_error_handler_io.dart:89:18)

I/flutter (19183): ERROR │ #1 HttpInterceptor.onError (package:thingsboard_pe_client/src/interceptor/http_interceptor.dart:104:19)

I/flutter (19183): ERROR │ #2 DioMixin.fetch._errorInterceptorWrapper... (package:dio/src/dio_mixin.dart:574:28)

I/flutter (19183): ERROR │ #3 DioMixin.checkIfNeedEnqueue (package:dio/src/dio_mixin.dart:789:22)

I/flutter (19183): ERROR │ #4 DioMixin.fetch._errorInterceptorWrapper.. (package:dio/src/dio_mixin.dart:572:22)

I/flutter (19183): ERROR │ #5 new Future. (dart:async/future.dart:253:37)

I/flutter (19183): ERROR │ #6 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)

I/flutter (19183): ERROR │ #7 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)

I/flutter (19183): ERROR │ #8 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)

I/flutter (19183): ERROR │ #9 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)

I/flutter (19183): ERROR │
I/flutter (19183): ERROR `

My application is intended to give various information to the user, so I do not intend to change the rights of the server to allow the application to modify the information on the server. So how can I make the app work ?

@ybeshkarov
Copy link
Contributor

Hello @3eme-oeil!

The dashboard page opened with access and refresh token, from the mobile perspective it's just a webview.
You may see it there lib/modules/dashboard/dashboard.dart

_initialUrl = Uri.parse(ThingsboardAppConstants.thingsBoardApiEndpoint + '?accessToken=${tbClient.getJwtToken()!}&refreshToken=${tbClient.getRefreshToken()!}');

You probably need to modify your ThingsBoard server to make it available without those tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants