feat(login): redirect when Router::fullBaseUrl() is not same as App.loginUrl#65
Merged
watura merged 3 commits intoNetCommons3:availabilityfrom Jan 8, 2020
WillBooster:wtr/login-redirect
Merged
feat(login): redirect when Router::fullBaseUrl() is not same as App.loginUrl#65watura merged 3 commits intoNetCommons3:availabilityfrom WillBooster:wtr/login-redirect
watura merged 3 commits intoNetCommons3:availabilityfrom
WillBooster:wtr/login-redirect
Conversation
1 similar comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
やったこと
application.yml に App.loginUrl を定義した状態で、
なお、楽に確認するためには NetCommons3/NetCommons#561 とかがはいっているといいです。
example.com.ymlとsecure.example.com.ymlを用意して、example.com.yml には、fullBaseUrl と loginUrlを定義すると、テストがやりやすくなります。なぜやるか
CDNで http://example.com はキャッシュして、http://secure.example.com はキャッシュしない。
でも、http://example.com から、利用者はほぼ考えることなく、 http://secure.example.com に遷移できるようにしたい。
ログイン画面に遷移しようとした時に、自動的に遷移させるようにすると、利用者は考えなくても遷移できているはずだ。と言う考えから実装しました。
もっとNC3の深いところから、secureとnon-secureを分けて動作するようにするのもよいかと思ったんですが、影響範囲が大きくなって、テストが難しくなるので、シンプルに分けるようにしました。
レビュー観点