Commit 8cb0d64 1 parent 72ef938 commit 8cb0d64 Copy full SHA for 8cb0d64
File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,12 @@ ckanext.vip_portal.extra_allowed_prefixes = /dataset /organization /group /stati
87
87
# (optional, default: )
88
88
ckanext.vip_portal.extra_allowed_suffixes = .svg .html .css
89
89
90
+ # Allows to customize the route that the user will get redirected to
91
+ # after a successful login. Empty value allow user to be redirected to the page
92
+ # requested before displaying login page
93
+ # (optional, default: )
94
+ ckan.auth.route_after_login = dataset.search
95
+
90
96
```
91
97
92
98
Original file line number Diff line number Diff line change 5
5
6
6
import ckan .plugins as p
7
7
import ckan .plugins .toolkit as tk
8
+ import ckan .lib .helpers as h
8
9
9
10
from . import config , utils , interfaces
10
11
@@ -79,7 +80,13 @@ def identify(self):
79
80
if user :
80
81
resp = tk .abort (403 , tk ._ ("Not authorized to view this page" ))
81
82
else :
82
- resp = tk .h .redirect_to (config .login_endpoint ())
83
+ came_from = None
84
+ if tk .config .get ("ckan.auth.route_after_login" ):
85
+ came_from = h .url_for (tk .config .get ("ckan.auth.route_after_login" ))
86
+ resp = tk .h .redirect_to (
87
+ config .login_endpoint (),
88
+ came_from = came_from or tk .request .path
89
+ )
83
90
84
91
resp .headers .update (
85
92
{
You can’t perform that action at this time.
0 commit comments