mirror of
https://github.com/git-touch/git-touch
synced 2025-01-18 18:29:59 +01:00
refactor: oauth process
This commit is contained in:
parent
65bebf63ea
commit
e97befd412
@ -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,
|
||||
}),
|
||||
|
@ -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';
|
Loading…
Reference in New Issue
Block a user