Giter VIP home page Giter VIP logo

Comments (5)

lynndylanhurley avatar lynndylanhurley commented on May 20, 2024

@UrbanViking - I'm not sure that I understand what you're suggesting here. Are you saying that this template should be renamed?

from ng-token-auth.

 avatar commented on May 20, 2024

Please correct if I understood the flow of RequestPasswordReset and ChangePassword

User opens RequestPasswordReset template, enter email and then submit button that trigger the RequestPasswordReset action, that sends the user an email with password reset instructions. Within that email there is a link to change password.

The user click this link and should now see a ChangePassword template with the input fields password and password_confirmation.

But the link within the RequestPasswordReset template has the link to the the RequestPasswordReset template.

Said with other words, shouldn't the RequestPasswordReset template have a link to ChangePassword template?

from ng-token-auth.

lynndylanhurley avatar lynndylanhurley commented on May 20, 2024

What do you mean by the terms "RequestPasswordReset template" and "ChangePassword template"?

from ng-token-auth.

 avatar commented on May 20, 2024

The mailer that is sent from the RequestPasswordReset
https://github.com/lynndylanhurley/devise_token_auth/blob/master/app/views/devise/mailer/reset_password_instructions.html.erb has this link:
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url'].to_s) %></p>

When I click that link in the mail, I get the same template from where I requested the password reset. Shouldn't the link give me the template where I can enter a password and submit my new password?

This is how the mailer in Devise looks like
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>

The difference is the redirect_url as you can see. It looks that I don't get the edit_password_url for devise_token_auth/passwords#update but I am redirected to edit_password_url for devise_token_auth/passwords#create.

from ng-token-auth.

lynndylanhurley avatar lynndylanhurley commented on May 20, 2024

You can redirect to any URL that you want. For example:

angular.module('myApp', ['ng-token-auth'])
  .config(function($authProvider) {
    $authProvider.configure({
      apiUrl: '/api',
      confirmationSuccessUrl: 'http://example.com/account-create-success',
      passwordResetSuccessUrl: 'http://example.com/password-change-success'
    });
  });

This will cause the link in the confirmation email to redirect to http://example.com/account-create-success, and the link in the password reset confirmation email to redirect to http://example.com/password-change-success.

This is explained in the docs.

from ng-token-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.