Skip to content

Commit b1ffdc6

Browse files
committed
chore: Remove debug print statements and add redirect after successful login
1 parent 7764d98 commit b1ffdc6

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

penify_hook/api_client.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,9 @@ def generate_commit_summary(self, git_diff, instruction: str = "", repo_details
132132
def get_api_key(self):
133133

134134
url = self.api_url+"/v1/apiToken/get"
135-
print(url)
136135
response = requests.get(url, headers={"Authorization": f"Bearer {self.BEARER_TOKEN}"}, timeout=60*10)
137-
print(response)
138136
if response.status_code == 200:
139137
response = response.json()
140-
print(response)
141138
return response.get('key')
142139
else:
143140
print(f"Response: {response.status_code}")

penify_hook/main.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ def save_credentials(api_key):
125125
try:
126126
with open(penify_file, 'w') as f:
127127
json.dump(credentials, f)
128-
print(f"Credentials saved successfully in {penify_file}")
129128
except Exception as e:
130129
print(f"Error saving credentials: {str(e)}")
131130

@@ -155,18 +154,27 @@ def do_GET(self):
155154
self.end_headers()
156155
response = """
157156
<html>
157+
<head>
158+
<script>
159+
setTimeout(function() {
160+
window.location.href = 'https://dashboard.penify.dev';
161+
}, 5000);
162+
</script>
163+
</head>
158164
<body>
159-
<h1>Login Successful!</h1>
160-
<p>You can now close this window and return to the CLI.</p>
165+
<h1>Login Successful!</h1>
166+
<p>You will be redirected to the Penify dashboard in 5 seconds. You can also close this window and return to the CLI.</p>
161167
</body>
162168
</html>
163169
"""
164170
self.wfile.write(response.encode())
171+
165172
print(f"\nLogin successful! Fetching API keys...")
166-
api_key = APIClient(api_url,None, token).get_api_key()
173+
api_key = APIClient(api_url, None, token).get_api_key()
167174
if api_key:
168175
save_credentials(api_key)
169176
print("API keys fetched and saved successfully.")
177+
print("You'll be redirected to the Penify dashboard. You can continue using the CLI.")
170178
else:
171179
print("Failed to fetch API keys.")
172180
else:

0 commit comments

Comments
 (0)