diff --git a/README.md b/README.md index a9f85eb8..928be770 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # angel_client -[![pub 1.0.1](https://img.shields.io/badge/pub-1.0.1-brightgreen.svg)](https://pub.dartlang.org/packages/angel_client) +[![pub 1.0.2](https://img.shields.io/badge/pub-1.0.2-brightgreen.svg)](https://pub.dartlang.org/packages/angel_client) [![build status](https://travis-ci.org/angel-dart/client.svg)](https://travis-ci.org/angel-dart/client) Client library for the Angel framework. diff --git a/lib/auth_types.dart b/lib/auth_types.dart index 4328fa16..6c57d352 100644 --- a/lib/auth_types.dart +++ b/lib/auth_types.dart @@ -1,2 +1 @@ -const String GOOGLE = 'google'; const String LOCAL = 'local'; \ No newline at end of file diff --git a/lib/base_angel_client.dart b/lib/base_angel_client.dart index 639f6d2c..73e56a49 100644 --- a/lib/base_angel_client.dart +++ b/lib/base_angel_client.dart @@ -8,7 +8,6 @@ import 'package:http/src/request.dart' as http; import 'package:http/src/response.dart' as http; import 'package:http/src/streamed_response.dart' as http; import 'angel_client.dart'; -import 'auth_types.dart' as auth_types; final RegExp straySlashes = new RegExp(r"(^/)|(/+$)"); const Map _readHeaders = const {'Accept': 'application/json'}; @@ -56,7 +55,7 @@ abstract class BaseAngelClient extends Angel { @override Future authenticate( - {String type: auth_types.LOCAL, + {String type, credentials, String authEndpoint: '/auth', String reviveEndpoint: '/auth/token'}) async { diff --git a/lib/browser.dart b/lib/browser.dart index 231c2340..1bfe09a2 100644 --- a/lib/browser.dart +++ b/lib/browser.dart @@ -16,7 +16,7 @@ class Rest extends BaseAngelClient { @override Future authenticate( - {String type: auth_types.LOCAL, + {String type, credentials, String authEndpoint: '/auth', String reviveEndpoint: '/auth/token'}) async { @@ -28,6 +28,7 @@ class Rest extends BaseAngelClient { try { final result = await super.authenticate( + type: null, credentials: {'token': JSON.decode(window.localStorage['token'])}, reviveEndpoint: reviveEndpoint); window.localStorage['token'] = JSON.encode(authToken = result.token); diff --git a/pubspec.yaml b/pubspec.yaml index 2fab6c13..67bd32be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_client -version: 1.0.1 +version: 1.0.2 description: Client library for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_client