混淆电子邮件地址和密码设计导轨?

发布于 2025-01-31 16:33:46 字数 977 浏览 5 评论 0原文

使用设计进行身份验证,

我想混淆用户信息(例如用户名和密码),当请求来自客户端时,

<%= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name, service: params[:service]), html: { class: 'm-t' }) do |f| %>

  <%= devise_error_messages! %>

  <%= f.email_field :name, required: true, hide_label: true, placeholder: 'Name' %>
  <%= f.password_field :password, required: true, hide_label: true, placeholder: 'Password'%>

  <%= f.submit "Sign In", class: 'btn btn-primary btn-block dark-button-text' %>

<% end %>

请求主体中的名称和密码可见,应该加密,我正在尝试使用JavaScript,


  $(document).ready(function() {
    $('form#new_user').submit(function() {
      let userPassword = $('#user_password')
      let userName = $('#user_name')
      userPassword.val(window.btoa(userPassword.val()))
      userName.val(window.btoa(userName.val()))
    })
  })


但是浏览器上的此更新值。

在应用程序中,如何解密与设计会话控制器相同的是对传入请求进行消毒。

Using Devise for Authentication

I want to Obfuscate user information like username and password when request comes from the client side

<%= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name, service: params[:service]), html: { class: 'm-t' }) do |f| %>

  <%= devise_error_messages! %>

  <%= f.email_field :name, required: true, hide_label: true, placeholder: 'Name' %>
  <%= f.password_field :password, required: true, hide_label: true, placeholder: 'Password'%>

  <%= f.submit "Sign In", class: 'btn btn-primary btn-block dark-button-text' %>

<% end %>

The name and password in the request body are visible which should be encrypted, i am trying to use javascript


  $(document).ready(function() {
    $('form#new_user').submit(function() {
      let userPassword = $('#user_password')
      let userName = $('#user_name')
      userPassword.val(window.btoa(userPassword.val()))
      userName.val(window.btoa(userName.val()))
    })
  })


But this updating value on the browser.

On application how to decrypt the same as devise session controller is doing sanitizing of the incoming request.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文