refactor: refactoring client and auth files

This commit is contained in:
Patrick Stewart 2024-12-15 11:13:05 -07:00
parent b0fee2ca94
commit 0f70a5bc8e
6 changed files with 6 additions and 6 deletions

View file

@ -52,7 +52,7 @@ configureServer(Angel app) async {
## Default Authentication Callback ## Default Authentication Callback
A frequent use case within SPA's is opening OAuth login endpoints in a separate window. [`angel3_client`](https://pub.dev/packages/angel3_client) provides a facility for this, which works perfectly with the default callback provided in this package. A frequent use case within SPA's is opening OAuth login endpoints in a separate window. [`platform_client`](https://pub.dev/packages/platform_client) provides a facility for this, which works perfectly with the default callback provided in this package.
```dart ```dart
configureServer(Angel app) async { configureServer(Angel app) async {
@ -75,7 +75,7 @@ configureServer(Angel app) async {
} }
``` ```
This renders a simple HTML page that fires the user's JWT as a `token` event in `window.opener`. `angel3_client` [exposes this as a Stream](https://pub.dev/documentation/angel3_client/latest/): This renders a simple HTML page that fires the user's JWT as a `token` event in `window.opener`. `platform_client` [exposes this as a Stream](https://pub.dev/documentation/platform_client/latest/):
```dart ```dart
app.authenticateViaPopup('/auth/google').listen((jwt) { app.authenticateViaPopup('/auth/google').listen((jwt) {

View file

@ -8,7 +8,7 @@ import 'dart:convert';
import 'package:http/browser_client.dart' as http; import 'package:http/browser_client.dart' as http;
import 'platform_client.dart'; import 'platform_client.dart';
// import 'auth_types.dart' as auth_types; // import 'auth_types.dart' as auth_types;
import 'base_angel_client.dart'; import 'base_platform_client.dart';
export 'platform_client.dart'; export 'platform_client.dart';
/// Queries an Angel server via REST. /// Queries an Angel server via REST.

View file

@ -3,7 +3,7 @@ library angel_client.flutter;
import 'dart:async'; import 'dart:async';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'base_angel_client.dart'; import 'base_platform_client.dart';
export 'platform_client.dart'; export 'platform_client.dart';
/// Queries an Angel server via REST. /// Queries an Angel server via REST.

View file

@ -7,7 +7,7 @@ import 'package:platform_json_serializer/json_serializer.dart' as god;
import 'package:path/path.dart' as p; import 'package:path/path.dart' as p;
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'platform_client.dart'; import 'platform_client.dart';
import 'base_angel_client.dart'; import 'base_platform_client.dart';
export 'platform_client.dart'; export 'platform_client.dart';
/// Queries an Angel server via REST. /// Queries an Angel server via REST.

View file

@ -1,5 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'package:platform_client/base_angel_client.dart'; import 'package:platform_client/base_platform_client.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:http/src/base_client.dart' as http; import 'package:http/src/base_client.dart' as http;
import 'package:http/src/base_request.dart' as http; import 'package:http/src/base_request.dart' as http;