Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
a0f85774
Commit
a0f85774
authored
8 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Redirect after sign in to previous page (unless it's a sign in/up/etc page)
parent
6d7290f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/application_controller.rb
+8
-0
8 additions, 0 deletions
app/controllers/application_controller.rb
app/controllers/auth/sessions_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/auth/sessions_controller.rb
with
9 additions
and
1 deletion
app/controllers/application_controller.rb
+
8
−
0
View file @
a0f85774
...
...
@@ -10,10 +10,18 @@ class ApplicationController < ActionController::Base
rescue_from
ActionController
::
RoutingError
,
with: :not_found
rescue_from
ActiveRecord
::
RecordNotFound
,
with: :not_found
before_filter
:store_current_location
,
:unless
=>
:devise_controller?
def
raise_not_found
raise
ActionController
::
RoutingError
,
"No route matches
#{
params
[
:unmatched_route
]
}
"
end
private
def
store_current_location
store_location_for
(
:user
,
request
.
url
)
end
protected
def
not_found
...
...
This diff is collapsed.
Click to expand it.
app/controllers/auth/sessions_controller.rb
+
1
−
1
View file @
a0f85774
...
...
@@ -12,6 +12,6 @@ class Auth::SessionsController < Devise::SessionsController
protected
def
after_sign_in_path_for
(
_resource
)
root_path
stored_location_for
(
:user
)
||
root_path
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment