Skip to content

Commit

Permalink
feat: gitlab login by token
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Oct 6, 2019
1 parent 9c0b0f6 commit 2b6d45c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 48 deletions.
47 changes: 43 additions & 4 deletions lib/screens/login.dart
Expand Up @@ -132,11 +132,50 @@ class _LoginScreenState extends State<LoginScreen> {
}
}
},
),
_buildAddItem(
text: 'GitLab Account by Token',
onTap: () async {
var result =
await Provider.of<ThemeModel>(context).showConfirm(
context,
Column(
children: <Widget>[
CupertinoTextField(
placeholder: 'Access token',
onChanged: (v) {
setState(() {
_token = v;
});
},
),
SizedBox(height: 8),
Text(
'GitTouch needs these permissions',
style: TextStyle(
fontSize: 14, fontWeight: FontWeight.w400),
),
SizedBox(height: 8),
Text(
'api, read_user, read_repository',
style: TextStyle(
fontSize: 16, color: PrimerColors.blue500),
)
],
),
);
if (result == true) {
try {
await auth.loginToGitlab(
'https://gitlab.com', _token);
// TODO: Custom domain
} catch (err) {
Provider.of<ThemeModel>(context).showConfirm(
context, Text('Token invalid: $err'));
}
}
},
)
// _buildAddItem(
// text: 'GitLab Account',
// screenBuilder: (_) => LoginGitlabScreen(),
// )
],
),
),
Expand Down
44 changes: 0 additions & 44 deletions lib/screens/login_gitlab.dart

This file was deleted.

0 comments on commit 2b6d45c

Please sign in to comment.