ember简单auth用rails设计用户名而不是电子邮件?

问题描述 投票:0回答:1

我有一个rails api,我正在使用设计登录例程。我通过ember简单的auth将ember搞砸了。使用典型的设计电子邮件和密码进行操作并运行。我通常配置设计虽然使用LDAP认证很好。我遇到的问题是我使用用户名登录我的LDAP,而不是电子邮件地址。我通常会更改设备以查找用户名而不是我已完成的电子邮件地址。

我现在正在获得一个未经授权的401,并且看着我看起来仍在发送电子邮件的params。

你能改变ember simple auth来发送用户名而不是电子邮件吗?如果是这样,你怎么做?

authentication ember.js devise ruby-on-rails-5 ember-simple-auth
1个回答
1
投票

您必须扩展设计授权程序并将identificationAttributeName设置为username

// app/authorizers/devise.js
import DeviseAuthorizer from 'ember-simple-auth/authorizers/devise';

export default DeviseAuthorizer.extend({
  identificationAttributeName: 'username'
});

资料来源:ember-simple-auth

© www.soinside.com 2019 - 2024. All rights reserved.