mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-04-29 11:03:05 -05:00
@@ -728,9 +728,11 @@ class AuthModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
String _oauthState;
|
||||
void redirectToGithubOauth() {
|
||||
void redirectToGithubOauth([publicOnly = false]) {
|
||||
_oauthState = nanoid();
|
||||
var scope = Uri.encodeComponent('user,repo,read:org,notifications');
|
||||
final repoScope = publicOnly ? 'public_repo' : 'repo';
|
||||
final scope = Uri.encodeComponent(
|
||||
['user', repoScope, 'read:org', 'notifications'].join(','));
|
||||
launchUrl(
|
||||
'https://github.com/login/oauth/authorize?client_id=$clientId&redirect_uri=gittouch://login&scope=$scope&state=$_oauthState',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user