Conversation
|
I got both bi-api and bi-web running. Works like a charm! One question: I can't seem to get the However, when I delete that token and try to navigate to another page, it does the right thing beautifully: takes me to the home page, gives the needs-login dialog, and redirects to login. |
The Is the redirect flow for the navigating to a protected page from an external link working for you? |
nickpalladino
left a comment
There was a problem hiding this comment.
Test cases look to provide good coverage, a few minor comments
|
|
||
| @Inject | ||
| private UserService userService; | ||
| private String loginSuccessUrlCookieName = "redirect-login"; |
There was a problem hiding this comment.
Do we want the cookie name in the config file? You could then inject it here.
There was a problem hiding this comment.
changed and pushed
| MutableHttpResponse mutableHttpResponse = HttpResponse.seeOther(location); | ||
|
|
||
| Cookie cookie; | ||
| for(Iterator var4 = cookies.iterator(); var4.hasNext(); mutableHttpResponse = mutableHttpResponse.cookie(cookie)) { |
There was a problem hiding this comment.
Curious about these var4 and var6 variable names, maybe could be something a little more informative.
There was a problem hiding this comment.
This is just copied and pasted from the micronaut loginSuccessCookies method. Not a problem to change them for our use though.
There was a problem hiding this comment.
changed and pushed
| if (isValidURL(returnUrl)){ | ||
| locationUrl = returnUrl; | ||
| } | ||
| } catch (UnsupportedEncodingException e){} |
There was a problem hiding this comment.
May be useful to have a log entry instead of silent exception.
There was a problem hiding this comment.
changed and pushed
| returnUrl = URLDecoder.decode(returnUrl, StandardCharsets.UTF_8.name()); | ||
| if (isValidURL(returnUrl)){ | ||
| locationUrl = returnUrl; | ||
| } |
There was a problem hiding this comment.
May be useful to have a log entry for the invalid url case.
There was a problem hiding this comment.
changed and pushed
eawoods
left a comment
There was a problem hiding this comment.
All good, working well! Again I defer to Nick's judgement on various improvements.
Implements changes to check the cookies on successful login and looks for a cookie named
redirect-login. If the cookie is present, and has a valid url as its value, the user is redirected to that url on successful login. If the cookie is not present or is not a valid url, the user is redirected to the default url set in the config.Should be reviewed with PRO-33 on bi-web.