-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform login
when already logged in
#191
Comments
Hey, thanks for sharing your use case, we'll take this with the team and get back here with potential solutions or a fix. |
The command has a |
That appears to force me through the login process again which makes sense to me. I don't want to have to login everytime I run a script. |
Ah I see. Currently each command is supposed to prompt the user to log in when necessary. There is a possibility email=$(platform auth:info --no-auto-login email)
if [ -n "$email" ]; then
echo "Logged in as $email"
else
echo "Not logged in"
exit 1
fi (Or if it's an unattended script, perhaps you need an API token) |
That it does, but I find if the first call to |
Fair enough, I'd be glad to help if I can with the hell breaking loose, here or you could perhaps ask me on chat.platform.sh. For a login check, we need to perform some kind of API call - although we can check offline whether you have credentials saved, the session could still have been revoked or expired for a few different reasons. Something like this would perform that API call and prompt for login if necessary at the top of your script. email=$(platform auth:info --refresh email) |
I'd be useful if the login command supported someway of telling it to do nothing if I'm already logged in, I want to call it at the start of scripts that talk to Platform to ensure the user is logged in but it doesn't need to ask them if they want to login again. I've tried
platform login --{no-interaction,no,yes}
but these tell the command doesn't work non interactively.platform login --quiet
doesn't work either as it just silently does nothing.Could some other argument like
--if-already-logged-in-dont-nag-the-user
be added to turn off the "you're already logged in prompt"?The text was updated successfully, but these errors were encountered: