<gh_stars>0
#!/usr/bin/env python3.6

"""
pw2tkn.py - get your Litecord token using email/password authentication.

Usage:
    python pw2tkn.py your_user your_password
"""

import requests
import sys
import json

#API_URL = 'https://memework.org:8000/api'
API_URL = 'http://localhost:8000/api'
#API_URL = 'http://172.16.58.3:8000/api'
#API_URL = 'https://litecord.adryd.com/api'

def main(args):
    email = args[1]
    password = args[2]

    payload = {
        "email": email,
        "password": password
    }
    _payload = json.dumps(payload)
    _resp = requests.post(f'{API_URL}/auth/login', data=_payload, verify=False)
    print(_resp)
    resp = _resp.json()

    print(f"Your token is {resp.get('token')}")

if __name__ == '__main__':
    main(sys.argv)

#!/usr/bin/env python3.6

"""
pw2tkn.py - get your Litecord token using email/password authentication.

Usage:
    python pw2tkn.py your_user your_password
"""

import requests
import sys
import json

#API_URL = 'https://memework.org:8000/api'
API_URL = 'http://localhost:8000/api'
#API_URL = 'http://172.16.58.3:8000/api'
#API_URL = 'https://litecord.adryd.com/api'

def main(args):
    email = args[1]
    password = args[2]

    payload = {
        "email": email,
        "password": password
    }
    _payload = json.dumps(payload)
    _resp = requests.post(f'{API_URL}/auth/login', data=_payload, verify=False)
    print(_resp)
    resp = _resp.json()

    print(f"Your token is {resp.get('token')}")

if __name__ == '__main__':
    main(sys.argv)
#!/usr/bin/env python3.6 pw2tkn.py - get your Litecord token using email/password authentication.  Usage:     python pw2tkn.py your_user your_password #API_URL = 'https://memework.org:8000/api' #API_URL = 'http://172.16.58.3:8000/api' #API_URL = 'https://litecord.adryd.com/api'