summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-08-04 17:59:22 +0200
committerJohn Villalovos <john@sodarock.com>2022-08-04 09:42:00 -0700
commit0040b4337bae815cfe1a06f8371a7a720146f271 (patch)
tree07800bfa7f6178480643dbd50cccb068fbbb2447 /gitlab
parentaf21a1856aa904f331859983493fe966d5a2969b (diff)
downloadgitlab-0040b4337bae815cfe1a06f8371a7a720146f271.tar.gz
feat(client): warn user on misconfigured URL in `auth()`
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/client.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gitlab/client.py b/gitlab/client.py
index 2cd67dd..dc19243 100644
--- a/gitlab/client.py
+++ b/gitlab/client.py
@@ -364,12 +364,14 @@ class Gitlab:
return (None, None, None)
def auth(self) -> None:
- """Performs an authentication using private token.
+ """Performs an authentication using private token. Warns the user if a
+ potentially misconfigured URL is detected on the client or server side.
The `user` attribute will hold a `gitlab.objects.CurrentUser` object on
success.
"""
self.user = self._objects.CurrentUserManager(self).get()
+ self._check_url(self.user.web_url, path=self.user.username)
def version(self) -> Tuple[str, str]:
"""Returns the version and revision of the gitlab server.