fix oauth
This commit is contained in:
parent
30de8189bc
commit
532788e9e6
6 changed files with 110 additions and 17 deletions
|
@ -1,7 +1,20 @@
|
|||
import 'package:http/http.dart' as http;
|
||||
import '../settings.dart' as settings;
|
||||
import '../../global.dart' as global;
|
||||
|
||||
class Thread {}
|
||||
Future<http.Response> getTimelineFromServer() async {
|
||||
final token = await settings.loadToken();
|
||||
final baseUrl = await settings.loadInstanceUrl();
|
||||
final url = Uri(
|
||||
scheme: "https",
|
||||
host: baseUrl,
|
||||
path: "/api/v1/timelines/home",
|
||||
);
|
||||
|
||||
class Post {}
|
||||
Map<String, String> headers = {"Authorization": "Bearer $token"};
|
||||
headers.addAll(global.defaultHeaders);
|
||||
|
||||
class Timeline {}
|
||||
final response = await http.get(url, headers: headers);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue