File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ def create
5
5
user = User . find_by ( username : params [ :session ] [ :username ] )
6
6
if User . authenticate ( params [ :session ] [ :username ] , params [ :session ] [ :password ] )
7
7
sign_in ( user )
8
- redirect_to cluster_path
8
+ redirect_back ( fallback_location : cluster_path )
9
9
else
10
10
flash [ :danger ] = 'Invalid username or password'
11
- redirect_to login_path
11
+ redirect_back ( fallback_location : login_path )
12
12
end
13
13
end
14
14
Original file line number Diff line number Diff line change 31
31
32
32
delete '/logout' , to : 'sessions#destroy'
33
33
34
+ match '/login' => redirect ( '/' ) , via : :get
35
+
34
36
root 'cluster#index'
35
37
end
36
38
37
39
constraints Clearance ::Constraints ::SignedOut . new do
38
40
get '/login' , to : 'sessions#new'
39
41
post '/login' , to : 'sessions#create'
40
42
43
+ match '*path' , to : 'sessions#new' , via : :get
44
+
41
45
root 'sessions#new'
42
46
end
43
47
end
You can’t perform that action at this time.
0 commit comments