+1
Fixed

new token expires date incorrect

bernie298 7 years ago updated by James 7 years ago 4

When adding a new token in the settings page.

The "expires on" and "created at" date time is incorrect.

For example my current date time value is: "Created On: January 1, 1970, 12:33 AM"

Could it be possible to give an example value near those fields. So I can enter the correct value in those fields.

Answer

+1
Answer

You put the values into these fields just like you get them from the Tesla API /oauth/token endpoint.

as an example, here's the values I just got:

access_token: nope_not_gonna_post_that

created_at: 1490169337

expires_in: 3888000

refresh_token: not_posting_this_one_either

token_type: bearer


The "created at" number is seconds since Jan 1, 1970 00:00:00.

The expires_in number is seconds from created_at.

I've just manually updated my token and ther may be an issue with the "expires in" input field - I put in the value above, which is 45 days but the displayed expireation is 90 days.


+1
Fixed

Thank you @mabene.


@bernie298 I added a placeholder to the renew token form which shows an example of the created_at and expires_in entry.


@mabene, I did find an error in the token expiration calculation. I had it as a fixed 90 days instead of calculating using the expires_in field. I corrected the settings page to reflect the correct date and the email notification script as well.


Please let me know if you see any issues.


Thanks!


James

+1

One issue I believe: The placeholder text in the token form is backwards.


Expires In placeholder is set to  "example: 1490169337" e.g., 03/22/2017 @ 7:55am (UTC)

Created At placeholder is set to "example: 3888000" e.g., 45 days. 


Suggestion would be to switch the two, and possibly have a default form value of 3888000 for the "expires in" (is it ever different?).


Thanks!

+1

Thanks.  Corrected and added the default value to the expires field.

+1
Answer

You put the values into these fields just like you get them from the Tesla API /oauth/token endpoint.

as an example, here's the values I just got:

access_token: nope_not_gonna_post_that

created_at: 1490169337

expires_in: 3888000

refresh_token: not_posting_this_one_either

token_type: bearer


The "created at" number is seconds since Jan 1, 1970 00:00:00.

The expires_in number is seconds from created_at.

I've just manually updated my token and ther may be an issue with the "expires in" input field - I put in the value above, which is 45 days but the displayed expireation is 90 days.


Commenting disabled