-
Notifications
You must be signed in to change notification settings - Fork 37
/
routes.rb
44 lines (39 loc) · 1.62 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Rails.application.routes.draw do
devise_for :password_users
# Passwordless users with :confirmable behavior
# (users are logged out until they confirm their email address)
devise_for :passwordless_confirmable_users,
controllers: { sessions: "devise/passwordless/sessions" }
# Passwordless users without :confirmable behavior
# (users are immediately signed-in after signing up)
devise_for :passwordless_users,
controllers: { sessions: "devise/passwordless/sessions" }
# Set up a namespace for testing custom controllers
namespace "test_custom_controllers" do
devise_for :passwordless_users,
controllers: {
sessions: "custom_sessions",
magic_links: "custom_magic_links"
}
get "foo", to: ->(env) { [200, {}, ["foo"]] }
get "bar", to: ->(env) { [200, {}, ["bar"]] }
end
# Set up a namespace for testing custom after_magic_link_sent_path_for
namespace "test_custom_after_magic_link_sent_redirect" do
devise_for :passwordless_users,
controllers: {
sessions: "after_magic_link_sent_sessions"
}
get "baz", to: ->(env) { [200, {}, ["baz"]] }
end
get "custom_after_magic_link_sent", to: ->(env) { [200, {}, ["custom_after_magic_link_sent"]] }
# Combined users which can behave as either password or passwordless users
devise_for :combined_users
# Passwordless login gets its own namespace because it uses a separate sessions controller
namespace "passwordless" do
devise_for :combined_users,
#only: [:sessions, :registrations, :passwords],
controllers: { sessions: "devise/passwordless/sessions" }
end
root to: "welcome#index"
end