1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-21 14:01:02 +01:00

improvement: trim login credentials

This commit is contained in:
Rongjian Zhang 2020-02-06 14:38:43 +08:00
parent cccf56d944
commit 181c6b297a

View File

@ -136,6 +136,8 @@ class AuthModel with ChangeNotifier {
} }
Future<void> loginToGitlab(String domain, String token) async { Future<void> loginToGitlab(String domain, String token) async {
domain = domain.trim();
token = token.trim();
loading = true; loading = true;
notifyListeners(); notifyListeners();
try { try {
@ -191,6 +193,8 @@ class AuthModel with ChangeNotifier {
} }
Future loginToGitea(String domain, String token) async { Future loginToGitea(String domain, String token) async {
domain = domain.trim();
token = token.trim();
try { try {
loading = true; loading = true;
notifyListeners(); notifyListeners();
@ -235,6 +239,9 @@ class AuthModel with ChangeNotifier {
} }
Future loginToBb(String domain, String username, String appPassword) async { Future loginToBb(String domain, String username, String appPassword) async {
domain = domain.trim();
username = username.trim();
appPassword = appPassword.trim();
try { try {
loading = true; loading = true;
notifyListeners(); notifyListeners();