1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Make browser login the default

This commit is contained in:
Ivan Habunek 2018-06-15 09:39:28 +02:00
parent 16c2741181
commit aabfd0fa31
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
3 changed files with 9 additions and 7 deletions

View File

@ -6,6 +6,8 @@ Changelog
* Add support for replying to a toot (#6)
* Add `toot delete` command for deleting a toot (#54)
* Add global `--quiet` flag to silence output (#46)
* Make `toot login` provide browser login, and `toot login_cli` log in via
console. This makes it clear what's the preferred option.
* Use Idempotency-Key header to prevent multiple toots being posted if request
is retried

View File

@ -92,7 +92,7 @@ def auth(app, user, args):
print_out("\nAuth tokens are stored in: <blue>{}</blue>".format(path))
def login(app, user, args):
def login_cli(app, user, args):
app = create_app_interactive(instance=args.instance)
login_interactive(app, args.email)
@ -100,7 +100,7 @@ def login(app, user, args):
print_out("<green>✓ Successfully logged in.</green>")
def login_browser(app, user, args):
def login(app, user, args):
app = create_app_interactive(instance=args.instance)
login_browser_interactive(app)

View File

@ -60,14 +60,14 @@ email_arg = (["-e", "--email"], {
AUTH_COMMANDS = [
Command(
name="login",
description="Log in from the console, does NOT support two factor authentication",
arguments=[instance_arg, email_arg],
description="Log into a mastodon instance using your browser (recommended)",
arguments=[instance_arg],
require_auth=False,
),
Command(
name="login_browser",
description="Log in using your browser, supports regular and two factor authentication",
arguments=[instance_arg],
name="login_cli",
description="Log in from the console, does NOT support two factor authentication",
arguments=[instance_arg, email_arg],
require_auth=False,
),
Command(