Skip to content
Snippets Groups Projects
Commit 8b543895 authored by Daniel Furaev's avatar Daniel Furaev
Browse files

generate auth token hoffentlich

parent 53dd42db
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ class SearchPage extends State<StateSearcgPage> {
@override
Widget build(BuildContext context) {
spotifyApi.generateAuthToken();
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(10.0),
......
......@@ -25,10 +25,10 @@ class Spotify {
final response = await http.post(
Uri.parse('https://accounts.spotify.com/api/token'),
body: {
'grant_type': 'password',
'username': email,
'password': password,
'scope': scope,
"grant_type": "authorization_code",
'client_id': "$clientId",
"client_secrete": "$clientSecret",
'scope': "$scope",
},
headers: {
'Authorization': encoded,
......@@ -37,6 +37,7 @@ class Spotify {
final responseJson = json.decode(response.body);
authToken = responseJson['access_token'];
print(authToken);
} catch (e) {
// TODO: Handle Error
}
......
......@@ -22,12 +22,11 @@ class SettingsDrawer extends StatelessWidget {
padding: EdgeInsets.zero,
children: [
UserAccountsDrawerHeader(
accountName: user['display_name'],
accountEmail: user['email'],
accountName: Text("Ambient"),
accountEmail: Text("ambient.spotify@gmail.com"),
currentAccountPicture: CircleAvatar(
child: ClipOval(
child: Image.network(
user['images'][0]['url'],
child: Image.network("https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/1200px-Angular_full_color_logo.svg.png",
width: 90,
height: 90,
fit: BoxFit.cover,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment