OSDN Git Service

move login/logout url from /login, /logout to /my/login, /my/logout
authorhylom <hylom@users.sourceforge.jp>
Thu, 25 Apr 2019 11:56:46 +0000 (20:56 +0900)
committerhylom <hylom@users.sourceforge.jp>
Thu, 25 Apr 2019 11:56:46 +0000 (20:56 +0900)
src/newslash_web/lib/Newslash/Web.pm
src/newslash_web/templates/common/account_bar.html.tt2
src/newslash_web/templates/index/banned.html.tt2
src/newslash_web/templates/login/activation.html.tt2
src/newslash_web/templates/login/login.html.tt2

index 08e6912..f6ae434 100644 (file)
@@ -265,9 +265,11 @@ sub startup {
     $r->get('/banned')->to('index#banned', noindex => 1);
 
     # Login / Logout
-    $r->get('/login')->to('login#login');
-    $r->post('/login')->to('login#login');
-    $r->get('/logout')->to('login#logout');
+    $r->get('/my/login')->to('login#login');
+    $r->post('/my/login')->to('login#login');
+    $r->get('/my/logout')->to('login#logout');
+    $r->get('/login' => sub {my $c = shift; $c->res->code(301); $c->redirect_to('/my/login');});
+    $r->get('/logout' => sub {my $c = shift; $c->res->code(301); $c->redirect_to('/my/logout');});
 
     # story page
     $r->get('/story/:sid/' => [sid => qr|\d\d/\d\d/\d\d/\d+|])
index ef240b5..912fe9e 100644 (file)
         <li><a href="/my/sidebar">サイドバー設定</a></li>
         <li><a href="/~[% user.nickname %]/journals">日記一覧</a></li>
         <li><a href="/journal/new">日記の新規作成</a></li>
-       <li><a href="/logout?rpath=[% helpers.url_for() %]">ログアウト</a></li>
+       <li><a href="/my/logout?rpath=[% helpers.url_for() %]">ログアウト</a></li>
       </ul>
     </li>
     [%- ELSE -%]
     <li class="abbrevable"><a href="https://srad.jp/my/newuser">アカウント作成</a></li>
-    <li><a class="toggle-login-modal" href="/login?rpath=[% helpers.url_for() %]">ログイン</a></li>
+    <li><a class="toggle-login-modal" href="/my/login?rpath=[% helpers.url_for() %]">ログイン</a></li>
     [%- END -%]
   </ul>
 
index 215db5f..3346990 100644 (file)
@@ -4,7 +4,7 @@
   <h3>You are banned.</h3>
   <div>
     <p>あなたが使用しているアカウントもしくはネットワークからのアクセスは禁止されています。</p>
-    <p>もしスラドにログインしていない場合、<a href="/login">ログイン</a>することで解決できるかもしれません。</p>
+    <p>もしスラドにログインしていない場合、<a href="/my/login">ログイン</a>することで解決できるかもしれません。</p>
   </div>
 </div>
 
index 2e78617..23a1739 100644 (file)
@@ -40,7 +40,7 @@
       <input class="btn btn-primary" :disabled="formError || state != ''" type="submit" @click.prevent.stop:="doPost" value="パスワードを設定する" />
     </form>
     <div class="alert-info" v-if="state == 'SUCCEED'">
-      パスワードを設定しました。<a href="/login">ログインページ</a>からこのパスワードでログインできます。
+      パスワードを設定しました。<a href="/my/login">ログインページ</a>からこのパスワードでログインできます。
     </div>
   </div><!-- .panel -->
 </div>
index 1ce940a..fe4f4c0 100644 (file)
@@ -1,7 +1,7 @@
 [% WRAPPER common/layout %]
 <h2>[% msg %]</h2>
 
-<form action="/login" method="post" enctype="application/x-www-form-urlencoded">
+<form action="/my/login" method="post" enctype="application/x-www-form-urlencoded">
   <input type="hidden" name="rpath" value="[% rpath %]"/>
   <p><label>nickname: <input type="text" name="nickname" value="[% nickname %]"/></label></p>
   <p><label>password: <input type="password" name="passwd" /></label></p>