After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699606 - Should pre-fill passwords for other users for whom a password was saved
Should pre-fill passwords for other users for whom a password was saved
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-03 16:56 UTC by Gustavo Noronha (kov)
Modified: 2013-08-14 11:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pre-fill password field when the username field loses focus (9.51 KB, patch)
2013-05-03 17:03 UTC, Gustavo Noronha (kov)
needs-work Details | Review
Pre-fill password field when the username field loses focus (9.66 KB, patch)
2013-08-04 15:44 UTC, Gustavo Noronha (kov)
committed Details | Review

Description Gustavo Noronha (kov) 2013-05-03 16:56:38 UTC
When you login with a different user on a site where you already have a stored password, Epiphany will offer to save the password and will do so if you tell it to, but there is no way to have it pre-fill the password field for the old user.
Comment 1 Gustavo Noronha (kov) 2013-05-03 17:03:01 UTC
Created attachment 243222 [details] [review]
Pre-fill password field when the username field loses focus

This change makes Web pass the username as a query attribute when querying
the secrets service when the username field loses focus, and pre-fills the
password field with the one that was stored for the username the user
typed in the username field.
Comment 2 Xan Lopez 2013-05-30 09:58:11 UTC
So without this patch we basically just get some default return value from secret right? The first one we entered in the table that matches the form username/password attributes?
Comment 3 Gustavo Noronha (kov) 2013-07-19 18:34:42 UTC
Oops, had missed your reply! Right, apparently "default" means the last saved one. I started working on a follow-up patch that would add UI that shows the available users, slowly pushing it forward.
Comment 4 Claudio Saavedra 2013-08-03 08:39:47 UTC
Review of attachment 243222 [details] [review]:

::: embed/web-extension/ephy-web-extension.c
@@ +372,3 @@
+  char *username_field_value = NULL;
+
+  g_object_get (ephy_embed_form_auth_get_username_node (form_auth),

Shouldn't it suffice with using username_node directly from the function parameters?

@@ +376,3 @@
+                NULL);
+
+  pre_fill_form (form_auth, username_field_value);

I am not sure, but I think it should be possible to get the username field value in pre_fill_form() instead? I don't think we need to query it here.

::: lib/ephy-form-auth-data.h
@@ +49,3 @@
                                                const char *form_username,
                                                const char *form_password,
+                                               const char *username,

I would place this parameter following the form_username one.
Comment 5 Gustavo Noronha (kov) 2013-08-04 15:44:11 UTC
Created attachment 250807 [details] [review]
Pre-fill password field when the username field loses focus

This change makes Web pass the username as a query attribute when querying
the secrets service when the username field loses focus, and pre-fills the
password field with the one that was stored for the username the user
typed in the username field.
Comment 6 Gustavo Noronha (kov) 2013-08-04 15:46:02 UTC
(In reply to comment #4)
> ::: lib/ephy-form-auth-data.h
> @@ +49,3 @@
>                                                 const char *form_username,
>                                                 const char *form_password,
> +                                               const char *username,
> 
> I would place this parameter following the form_username one.

I chose to do it like this so that it would be the same order used in the other calls that use those same parameters. I can move it if you think it'd be better, but I would prefer matching the other functions' order.
Comment 7 Claudio Saavedra 2013-08-14 08:59:09 UTC
Review of attachment 250807 [details] [review]:

Looks good now, thanks!
Comment 8 Gustavo Noronha (kov) 2013-08-14 11:38:11 UTC
Comment on attachment 250807 [details] [review]
Pre-fill password field when the username field loses focus

b99f082db53c71fc71080cd2283df2b95116b043
Comment 9 Gustavo Noronha (kov) 2013-08-14 11:38:25 UTC
Thanks!