Skip to content
Permalink
Browse files

Backend is registering app on new instances

  • Loading branch information
koyuawsmbrtn committed Jul 11, 2019
1 parent ac71fea commit ddf1c3cc6796270abead542164b7a8974e8e2590
Showing with 9 additions and 3 deletions.
  1. +2 −2 .gitignore
  2. +7 −1 backend.py
@@ -1,6 +1,6 @@
# Secrets

clientcred.secret
*.secret
authtokens/*.secret

# Mac
@@ -18,4 +18,4 @@ npm-debug.log
resources/signing
jsconfig.json
.vscode/
typings/
typings/
@@ -39,8 +39,14 @@ def login():
username = request.forms.get("username") # pylint: disable=no-member
password = request.forms.get("password") # pylint: disable=no-member
instance = request.forms.get("instance") # pylint: disable=no-member
if not os.path.exists('clientcred.'+instance+'.secret'):
Mastodon.create_app(
'Nordcast',
api_base_url = 'https://'+instance,
to_file = 'clientcred.'+instance+'.secret'
)
mastodon = Mastodon(
client_id = 'clientcred.secret',
client_id = 'clientcred.'+instance+'.secret',
api_base_url = 'https://'+instance
)
mastodon.log_in(

0 comments on commit ddf1c3c

Please sign in to comment.
You can’t perform that action at this time.