mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-08 02:24:30 +02:00
Redirect home for signed up users to their checks
This commit is contained in:
parent
d9c293da80
commit
f0ac2fc0c4
|
@ -15,6 +15,18 @@ class ApplicationController < ActionController::Base
|
||||||
devise_parameter_sanitizer.permit(:account_update, keys: [:notifications_enabled, :locale])
|
devise_parameter_sanitizer.permit(:account_update, keys: [:notifications_enabled, :locale])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def after_sign_in_path_for(_resource)
|
||||||
|
checks_path
|
||||||
|
end
|
||||||
|
|
||||||
|
def after_sign_up_path_for(_resource)
|
||||||
|
checks_path
|
||||||
|
end
|
||||||
|
|
||||||
|
def after_sign_out_path_for(_resource)
|
||||||
|
root_path
|
||||||
|
end
|
||||||
|
|
||||||
def user_not_authorized
|
def user_not_authorized
|
||||||
flash[:alert] = I18n.t("user_not_authorized", scope: :flashes)
|
flash[:alert] = I18n.t("user_not_authorized", scope: :flashes)
|
||||||
redirect_to(request.referrer || root_path)
|
redirect_to(request.referrer || root_path)
|
||||||
|
|
|
@ -2,5 +2,7 @@
|
||||||
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
||||||
|
|
||||||
class PagesController < ApplicationController
|
class PagesController < ApplicationController
|
||||||
def home; end
|
def home
|
||||||
|
redirect_to checks_path if user_signed_in?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<% # License: GNU AGPL-3+ (see full text in LICENSE file) %>
|
<% # License: GNU AGPL-3+ (see full text in LICENSE file) %>
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark justify-content-between">
|
<nav class="navbar navbar-expand-lg navbar-dark justify-content-between">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<%= link_to root_path , class: "navbar-brand" do %>
|
<%= link_to (user_signed_in? ? checks_path : root_path), class: "navbar-brand" do %>
|
||||||
<%= image_tag 'chexpire10.png', width: 200, alt: 'chexpire logo' %>
|
<%= image_tag 'chexpire10.png', width: 200, alt: 'chexpire logo' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
@ -52,7 +52,7 @@ class UsersTest < ApplicationSystemTestCase
|
||||||
|
|
||||||
click_button I18n.t("devise.sessions.new.sign_in")
|
click_button I18n.t("devise.sessions.new.sign_in")
|
||||||
|
|
||||||
assert_equal root_path, page.current_path
|
assert_equal checks_path, page.current_path
|
||||||
assert page.has_content?(@user.email)
|
assert page.has_content?(@user.email)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue