diff --git a/lib/models/auth.dart b/lib/models/auth.dart index 103a296..b927810 100644 --- a/lib/models/auth.dart +++ b/lib/models/auth.dart @@ -12,11 +12,12 @@ import 'package:url_launcher/url_launcher.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import '../utils/constants.dart'; import '../utils/utils.dart'; import 'account.dart'; import 'gitlab.dart'; +const clientId = 'df930d7d2e219f26142a'; + class PlatformType { static const github = 'github'; static const gitlab = 'gitlab'; @@ -64,14 +65,13 @@ class AuthModel with ChangeNotifier { // Get token by code final res = await http.post( - 'https://github.com/login/oauth/access_token', + 'https://git-touch-oauth.now.sh/api/token', headers: { HttpHeaders.acceptHeader: 'application/json', HttpHeaders.contentTypeHeader: 'application/json', }, body: json.encode({ 'client_id': clientId, - 'client_secret': clientSecret, 'code': uri.queryParameters['code'], 'state': _oauthState, }), diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart deleted file mode 100644 index 9b7ff5c..0000000 --- a/lib/utils/constants.dart +++ /dev/null @@ -1,6 +0,0 @@ -// These keys are for development, not the production keys -// You can also create OAuth App at https://github.com/settings/applications/new -// to get your own keys and replace these ones - -var clientId = '9b7d1cc04a1db5710767'; -var clientSecret = '710e085908dde6a8b55f7a9dc447ad5c0c5617d1';