How to make browser remember login username and password

Gravatar

Hi Flaglogic support,

I modified the form in Login.vue for calling my auth api and getting a JWT token. The login process is fine but browser does not remember form password. In my previous vue project, this form can be detected by browser and password is remembered without problem.

    <form id="form1" class="mt" @submit.prevent="login">
      <b-alert class="alert-sm" variant="danger" :show="!!errorMessage">
        {{errorMessage}}
      </b-alert>
      <div class="form-group">
        <input class="form-control no-border" ref="username" required type="text" name="username" placeholder="Username" />
      </div>
      <div class="form-group">
        <input class="form-control no-border" ref="password" required type="password" name="password" placeholder="Password" />
      </div>
      <b-button form="form1" type="submit" size="sm" class="auth-btn mb-3" variant="info">{{this.isFetching ? 'Loading...' : 'Login'}}</b-button>
    </form>

How should I do in Sing App vue for browser remembering the password?

Gravatar

Hi, houcheng )

Looks like the problem is in your browser You can try turning on the autocomplete feature Or try to access this page from another browser to check the error there.

Gravatar

Hi Alexsandr,

Oh, it seems my fault of using MSW in this project. The MSW is a javascript service worker for mocking backend api. Maybe chrome failed to catch the form submit request since MSW mocked it ealier. I'll try this form after the backend api team providing me a test endpoint.

Thank you for the support!

Gravatar

Hi houcheng,

Happy to help!

If you have any other questions, please let us know!

Best regards,
Eugene

Cookie Consent

By continuing to browse or by clicking 'OK', you agree to the storing of cookies on your device to enhance your site experience and for analytical purposes. To learn more about how we use cookies, please see our cookies policy.