headspace-cli icon indicating copy to clipboard operation
headspace-cli copied to clipboard

`headspace login` throws IndexError

Open kswang2400 opened this issue 3 years ago • 4 comments

trying to login with headspace login

│ /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyheadspace/auth.p │
│ y:54 in get_bearer_token                                                                         │
│                                                                                                  │
│   51 │   }                                                                                       │
│   52 │   response = session.get(BEARER_TOKEN_URL, params=params)                                 │
│   53 │   html = response.text                                                                    │
│ ❱ 54 │   bearer_token = re.findall(r'"access_token":"(.+?)"', html)[0]                           │
│   55 │   return bearer_token                                                                     │
│   56                                                                                             │
│   57                                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

kswang2400 avatar Mar 19 '22 06:03 kswang2400

Hi @kswang2400, I am unable to replicate this. Could you share the full traceback. Also you could try to log in manually by following this.

Are you using login with google or some other 3rd party login service?

yashrathi-git avatar Mar 19 '22 06:03 yashrathi-git

Hi I edited bearer_id.txt but now I still get a login error

Unautorized : Unable to login to headspace account Run headspace login first.

btw the typo

Is there any step I must do to get the program to use the token? it´s the correct one (from request and not response).

thanks

taladro avatar Oct 25 '23 15:10 taladro

Hi I edited bearer_id.txt but now I still get a login error

Unautorized : Unable to login to headspace account Run headspace login first.

btw the typo

Is there any step I must do to get the program to use the token? it´s the correct one (from request and not response).

thanks

I reply to myself so it can help someone in the future. You must include the word Bearer on the copied content.

taladro avatar Oct 25 '23 16:10 taladro

Hi I edited bearer_id.txt but now I still get a login error Unautorized : Unable to login to headspace account Run headspace login first. btw the typo Is there any step I must do to get the program to use the token? it´s the correct one (from request and not response). thanks

I reply to myself so it can help someone in the future. You must include the word Bearer on the copied content.

Thank you @taladro!!! This helped me!

ynfle avatar Feb 08 '24 05:02 ynfle