Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Jan 10, 2019

This saves a direct request to the server when loading the backup codes.
There is no need for this as the data is already known.

Signed-off-by: Roeland Jago Douma [email protected]

@rullzer
Copy link
Member Author

rullzer commented Jan 10, 2019

I also bumped the dependencies and added the compiled assets to the gitattributes

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nitpick

will test in a minute, just to see how fast it loads :)

el: '#twofactor-backupcodes-settings',
render: h => h(PersonalSettings)
});
const initialStateElem = JSON.parse(atob(document.getElementById('twofactor-backupcodes-initial-state').value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: the variable name is misleading. I guess you wanted to do the .value below when you pass it to the store

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right fair enough...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use atob?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is base64 encoded. Else we might run into some random errors with quotes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still feels more error prone. base64 is guaranteed not to contain special chars that might break things

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! Let's add this to #13488

@rullzer
Copy link
Member Author

rullzer commented Jan 14, 2019

@skjnldsv can I also get a 👍 😉

@rullzer rullzer force-pushed the omit_fetching_state branch from 53b7345 to 972f9e3 Compare January 14, 2019 06:47
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works nicely 👍

This saves a direct request to the server when loading the backup codes.
There is no need for this as the data is already known.

Signed-off-by: Roeland Jago Douma <[email protected]>
Signed-off-by: Roeland Jago Douma <[email protected]>
Signed-off-by: Roeland Jago Douma <[email protected]>
Signed-off-by: Roeland Jago Douma <[email protected]>
@rullzer rullzer force-pushed the omit_fetching_state branch from 972f9e3 to 90f8687 Compare January 15, 2019 19:51
@rullzer rullzer merged commit b58f3e7 into master Jan 16, 2019
@rullzer rullzer deleted the omit_fetching_state branch January 16, 2019 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants