Skip to content

Instantly share code, notes, and snippets.

@nparsons08
Created Dec 11, 2019
Embed
What would you like to do?
// mobile/lib/api_service.dart:10
Future<Map> login(String user) async {
var authResponse = await http.post('$_baseUrl/v1/users', body: {'sender': user});
var authToken = json.decode(authResponse.body)['authToken'];
var feedResponse = await http
.post('$_baseUrl/v1/stream-feed-credentials', headers: {'Authorization': 'Bearer $authToken'});
var feedToken = json.decode(feedResponse.body)['token'];
return {'authToken': authToken, 'feedToken': feedToken};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment