Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
a1eb1ad1
Commit
a1eb1ad1
authored
Jun 18, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect back to current page after sign in.
parent
b6435147
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+13
-1
No files found.
app/controllers/application_controller.rb
View file @
a1eb1ad1
require
'gon'
class
ApplicationController
<
ActionController
::
Base
before_filter
:store_location
before_filter
:authenticate_user!
before_filter
:reject_blocked!
before_filter
:check_password_expiration
...
...
@@ -48,7 +49,18 @@ class ApplicationController < ActionController::Base
flash
[
:alert
]
=
"Your account is blocked. Retry when an admin has unblocked it."
new_user_session_path
else
super
session
[
:previous_url
]
||
root_path
end
end
def
store_location
# store last url - this is needed for post-login redirect to whatever the user last visited.
if
(
request
.
fullpath
!=
"/users/sign_in"
&&
request
.
fullpath
!=
"/users/sign_up"
&&
request
.
fullpath
!=
"/users/password"
&&
request
.
fullpath
!=
"/users/sign_out"
&&
!
request
.
xhr?
)
# don't store ajax calls
session
[
:previous_url
]
=
request
.
fullpath
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment