Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Everytime I open app, I need to login again. Is there any way to auto login without entering user name and password again as drupal websites?
Thanks
Comments
Comment #1
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedI believe OAuth is the solution for this. I haven't tried it yet though, and won't have time until someone steps forth to contribute/sponsor its DrupalGap implementation.
Comment #2
coolman7 CreditAttribution: coolman7 commentedI have no knowledge about OAuth, so I made a workaround until better and more secure way is implemented. This works for me. But I don't think it is secure to store password in localstorage, but I can't find any other way. If someone knows more secure way, please share here, so I can change the code.
I added some code to user.js:
And one line to drupalgap.js:
Comment #3
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedI wouldn't recommend hacking DrupalGap core to do this, instead this could be accomplished with custom submit handlers and hook_services_*, and probably hook_deviceready() too. Even then, I'm going to go ahead and say that storing someone's password plain text in local storage isn't a good idea, aka security concern.