-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
106 lines (85 loc) · 2.77 KB
/
main.py
File metadata and controls
106 lines (85 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
from authvaultix import AuthVaultixClient
import sys
import platform
import os
from time import sleep
def clear():
if platform.system() == 'Windows':
os.system('Authvaultix Python-Example')
else:
os.system('clear')
def exit_app(msg="", delay=2):
if msg:
print(msg)
sleep(delay)
sys.exit()
print("Connecting...")
AuthVaultixapp = AuthVaultixClient(
"", # App name
"", # Account ID
"", # Application secret
"1.0", # Application version
api_url="https://authvaultix.com/api/1.0/"
)
def auth_menu():
while True:
try:
print("""
1. Login
2. Register
3. License Key Only
4. Upgrade
5. Forgot Password
""")
ans = input("Select Option: ").strip()
if ans == "1":
user = input('Username: ')
password = input('Password: ')
return AuthVaultixapp.login(user, password)
elif ans == "2":
user = input('Username: ')
password = input('Password: ')
license = input('License: ')
return AuthVaultixapp.register(user, password, license)
elif ans == "3":
license = input('Enter License: ')
return AuthVaultixapp.license_login(license)
elif ans == "4":
user = input('Username: ')
license = input('Upgrade License: ')
AuthVaultixapp.upgrade(user, license)
exit_app("Please restart the program and login.", 2)
elif ans == "5":
user = input('Username: ')
email = input('Email: ')
AuthVaultixapp.forgot_password(user, email)
exit_app("Check your email for the password reset link.", 2)
else:
print("Invalid option\n")
sleep(1)
clear()
except KeyboardInterrupt:
exit_app("\nUser exited.")
# Run auth
auth_menu()
# ===============================
# CLEAN USER DATA DISPLAY
# ===============================
info = AuthVaultixapp.get_user_info()
if not info:
exit_app("\nNo user data available - login first.")
print("\n=== User Data ===")
print("Username:", info["username"])
print("IP:", info["ip"])
print("HWID:", info["hwid"])
print("Created:", info["created"])
print("Last Login:", info["last_login"])
# Subscriptions
subs = info.get("subscriptions", [])
if subs:
print("\nSubscriptions:")
for i, sub in enumerate(subs):
print(f"[{i+1}] {sub['name']} | Expiry: {sub['expiry']} | Timeleft: {sub['timeleft']}")
else:
print("No subscriptions found")
exit_app("\nExiting in 3 seconds...", 3)