Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
be41d84f
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
be41d84f
编写于
12月 14, 2015
作者:
D
Drew Blessing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow account unlock via email
上级
b95f7b18
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
35 addition
and
21 deletion
+35
-21
CHANGELOG
CHANGELOG
+1
-0
app/models/user.rb
app/models/user.rb
+1
-0
app/views/devise/mailer/unlock_instructions.html.erb
app/views/devise/mailer/unlock_instructions.html.erb
+0
-7
app/views/devise/mailer/unlock_instructions.html.haml
app/views/devise/mailer/unlock_instructions.html.haml
+10
-0
app/views/devise/unlocks/new.html.erb
app/views/devise/unlocks/new.html.erb
+0
-12
app/views/devise/unlocks/new.html.haml
app/views/devise/unlocks/new.html.haml
+14
-0
config/initializers/devise.rb
config/initializers/devise.rb
+2
-2
db/migrate/20151210030143_add_unlock_token_to_user.rb
db/migrate/20151210030143_add_unlock_token_to_user.rb
+5
-0
db/schema.rb
db/schema.rb
+1
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-0
未找到文件。
CHANGELOG
浏览文件 @
be41d84f
...
...
@@ -19,6 +19,7 @@ v 8.3.0 (unreleased)
- Recognize issue/MR/snippet/commit links as references
- Add ignore whitespace change option to commit view
- Fire update hook from GitLab
- Allow account unlock via email
- Style warning about mentioning many people in a comment
- Fix: sort milestones by due date once again (Greg Smethells)
- Migrate all CI::Services and CI::WebHooks to Services and WebHooks
...
...
app/models/user.rb
浏览文件 @
be41d84f
...
...
@@ -26,6 +26,7 @@
# bio :string(255)
# failed_attempts :integer default(0)
# locked_at :datetime
# unlock_token :string(255)
# username :string(255)
# can_create_group :boolean default(TRUE), not null
# can_create_team :boolean default(TRUE), not null
...
...
app/views/devise/mailer/unlock_instructions.html.erb
已删除
100644 → 0
浏览文件 @
b95f7b18
<p>
Hello
<%=
@resource
.
email
%>
!
</p>
<p>
Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
</p>
<p>
Click the link below to unlock your account:
</p>
<p>
<%=
link_to
'Unlock your account'
,
unlock_url
(
@resource
,
unlock_token:
@token
)
%>
</p>
app/views/devise/mailer/unlock_instructions.html.haml
0 → 100644
浏览文件 @
be41d84f
%p
Hello
#{
@resource
.
name
}
!
%p
Your GitLab account has been locked due to an excessive amount of unsuccessful
sign in attempts. Your account will automatically unlock in
=
time_ago_in_words
(
Devise
.
unlock_in
.
from_now
)
or you may click the link below to unlock now.
%p
=
link_to
'Unlock your account'
,
unlock_url
(
@resource
,
unlock_token:
@token
)
app/views/devise/unlocks/new.html.erb
已删除
100644 → 0
浏览文件 @
b95f7b18
<h2>
Resend unlock instructions
</h2>
<%=
form_for
(
resource
,
as:
resource_name
,
url:
unlock_path
(
resource_name
),
html:
{
method: :post
})
do
|
f
|
%>
<%=
devise_error_messages!
%>
<div>
<%=
f
.
label
:email
%>
<br
/>
<%=
f
.
email_field
:email
%>
</div>
<div>
<%=
f
.
submit
"Resend unlock instructions"
%>
</div>
<%
end
%>
<%=
render
partial:
"devise/shared/links"
%>
app/views/devise/unlocks/new.html.haml
0 → 100644
浏览文件 @
be41d84f
.login-box
.login-heading
%h3
Resend unlock email
.login-body
=
form_for
(
resource
,
as:
resource_name
,
url:
unlock_path
(
resource_name
),
html:
{
method: :post
})
do
|
f
|
.devise-errors
=
devise_error_messages!
.clearfix.append-bottom-20
=
f
.
email_field
:email
,
class:
'form-control'
,
placeholder:
'Email'
,
autofocus:
'autofocus'
,
autocapitalize:
'off'
,
autocorrect:
'off'
.clearfix
=
f
.
submit
'Resend unlock instructions'
,
class:
'btn btn-success'
.clearfix.prepend-top-20
=
render
'devise/shared/sign_in_link'
config/initializers/devise.rb
浏览文件 @
be41d84f
...
...
@@ -121,14 +121,14 @@ Devise.setup do |config|
config
.
lock_strategy
=
:failed_attempts
# Defines which key will be used when locking and unlocking an account
#
config.unlock_keys = [ :email ]
config
.
unlock_keys
=
[
:email
]
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
# :both = Enables both strategies
# :none = No unlock strategy. You should handle unlocking by yourself.
config
.
unlock_strategy
=
:
time
config
.
unlock_strategy
=
:
both
# Number of authentication tries before locking an account if lock_strategy
# is failed attempts.
...
...
db/migrate/20151210030143_add_unlock_token_to_user.rb
0 → 100644
浏览文件 @
be41d84f
class
AddUnlockTokenToUser
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:unlock_token
,
:string
end
end
db/schema.rb
浏览文件 @
be41d84f
...
...
@@ -837,6 +837,7 @@ ActiveRecord::Schema.define(version: 20151210125932) do
t
.
integer
"consumed_timestep"
t
.
integer
"layout"
,
default:
0
t
.
boolean
"hide_project_limit"
,
default:
false
t
.
string
"unlock_token"
end
add_index
"users"
,
[
"admin"
],
name:
"index_users_on_admin"
,
using: :btree
...
...
spec/models/user_spec.rb
浏览文件 @
be41d84f
...
...
@@ -26,6 +26,7 @@
# bio :string(255)
# failed_attempts :integer default(0)
# locked_at :datetime
# unlock_token :string(255)
# username :string(255)
# can_create_group :boolean default(TRUE), not null
# can_create_team :boolean default(TRUE), not null
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录