mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 02:18:50 +00:00
refactor(portal): Remove Dashboard, Landing pages and use sign_in for unauthenticated landing (#2175)
Fixes #2062 Fixes #2064 Fixes #2063 <img width="573" alt="Screenshot 2023-09-27 at 1 53 15 PM" src="https://github.com/firezone/firezone/assets/167144/3e487475-4e63-4aa0-8614-57579bb4aa95">
This commit is contained in:
@@ -39,17 +39,18 @@ the following general guidelines:
|
||||
1. Please test with your code and include unit tests when possible.
|
||||
1. It is up to you, the contributor, to make a case for why your change is a
|
||||
good idea.
|
||||
1. For any security issues, please **do not** open a Github Issue. Please
|
||||
follow responsible disclosure practices laid out in
|
||||
[SECURITY.md](SECURITY.md)
|
||||
1. For any security issues, please **do not** open a Github Issue. Please follow
|
||||
responsible disclosure practices laid out in [SECURITY.md](SECURITY.md)
|
||||
|
||||
## Quick Start
|
||||
|
||||
The goal of the quick start guide is to get an environment up and running quickly
|
||||
to allow you to get a feel for all of the various components that make up Firezone.
|
||||
The goal of the quick start guide is to get an environment up and running
|
||||
quickly to allow you to get a feel for all of the various components that make
|
||||
up Firezone.
|
||||
|
||||
Once you've verified all components are running successfully, the detailed developer
|
||||
guides can help with getting you setup to develop on a specific Firezone component.
|
||||
Once you've verified all components are running successfully, the detailed
|
||||
developer guides can help with getting you setup to develop on a specific
|
||||
Firezone component.
|
||||
|
||||
### Docker Setup
|
||||
|
||||
@@ -59,11 +60,13 @@ comes with `compose` included.
|
||||
|
||||
#### Test With Docker
|
||||
|
||||
When you want to test every component together the ideal way to go is to use docker.
|
||||
When you want to test every component together the ideal way to go is to use
|
||||
docker.
|
||||
|
||||
To do this you first need a seeded database, for that follow the steps on the
|
||||
[Elixir's README](elixir/readme#running-control-plane-for-local-development).
|
||||
Then you can do:
|
||||
|
||||
```sh
|
||||
# To start all the components
|
||||
docker compose up -d --build
|
||||
@@ -73,14 +76,13 @@ docker compose logs -f
|
||||
```
|
||||
|
||||
After this you will have running:
|
||||
* A portal
|
||||
* A gateway connected to the portal
|
||||
* A client connected to the portal
|
||||
* A relay connected to the portal
|
||||
* A resource on a network only with the gateway
|
||||
* The ip is `172.20.0.100`
|
||||
(And any other dependency for these to run)
|
||||
|
||||
- A portal
|
||||
- A gateway connected to the portal
|
||||
- A client connected to the portal
|
||||
- A relay connected to the portal
|
||||
- A resource on a network only with the gateway
|
||||
- The ip is `172.20.0.100` (And any other dependency for these to run)
|
||||
|
||||
```sh
|
||||
# To test that a client can ping the resource
|
||||
@@ -107,16 +109,17 @@ docker compose run --rm elixir /bin/sh -c "cd apps/domain && mix ecto.create &&
|
||||
docker compose up -d api web vault gateway client relay
|
||||
```
|
||||
|
||||
You should now be able to connect to `http://localhost:8080/<account-uuid-here>/sign_in`
|
||||
You should now be able to connect to `http://localhost:8080/<account-uuid-here>`
|
||||
and sign in with the following credentials:
|
||||
|
||||
```
|
||||
Email: firezone@localhost
|
||||
Password: Firezone1234
|
||||
```
|
||||
|
||||
The [`docker-compose.yml`](docker-compose.yml) file configures the Docker
|
||||
development environment. If you make any changes you feel would benefit
|
||||
all developers, feel free to open a PR to get them merged!
|
||||
development environment. If you make any changes you feel would benefit all
|
||||
developers, feel free to open a PR to get them merged!
|
||||
|
||||
### Ensure Everything Works
|
||||
|
||||
@@ -128,20 +131,22 @@ all developers, feel free to open a PR to get them merged!
|
||||
|
||||
### Git Commit Signing
|
||||
|
||||
Firezone requires that all commits in the repository be signed. If you need assistance
|
||||
setting up `git` to sign commits, please read over the Github pages for
|
||||
Firezone requires that all commits in the repository be signed. If you need
|
||||
assistance setting up `git` to sign commits, please read over the Github pages
|
||||
for
|
||||
[Managing Commit signature verification](https://docs.github.com/en/authentication/managing-commit-signature-verification)
|
||||
|
||||
### Docker Setup
|
||||
|
||||
Docker is the preferred method of developing Firezone locally. It (mostly)
|
||||
works cross-platform, and can be used to develop Firezone on all three
|
||||
major desktop OS.
|
||||
Docker is the preferred method of developing Firezone locally. It (mostly) works
|
||||
cross-platform, and can be used to develop Firezone on all three major desktop
|
||||
OS.
|
||||
|
||||
If you have followed the [Docker Setup](#docker-setup) instructions in the Quick Start
|
||||
section, you can move along to the next step in the development environment setup.
|
||||
If you have not read the Docker Setup instructions we recommend following the directions
|
||||
listed there to get your Docker environment setup properly.
|
||||
If you have followed the [Docker Setup](#docker-setup) instructions in the Quick
|
||||
Start section, you can move along to the next step in the development
|
||||
environment setup. If you have not read the Docker Setup instructions we
|
||||
recommend following the directions listed there to get your Docker environment
|
||||
setup properly.
|
||||
|
||||
### asdf-vm Setup
|
||||
|
||||
@@ -150,10 +155,11 @@ language versions for Firezone. You'll need to install the language runtimes
|
||||
according to the versions laid out in the [.tool-versions](.tool-versions) file.
|
||||
|
||||
If using asdf, simply run `asdf install` from the project root.
|
||||
* Note: For a fresh install of `asdf` you will need to install some
|
||||
[asdf-plugins](https://asdf-vm.com/manage/plugins.html). Running `asdf install`
|
||||
will show which `asdf` plugins need to be installed prior to installing the
|
||||
required language runtimes.
|
||||
|
||||
- Note: For a fresh install of `asdf` you will need to install some
|
||||
[asdf-plugins](https://asdf-vm.com/manage/plugins.html). Running
|
||||
`asdf install` will show which `asdf` plugins need to be installed prior to
|
||||
installing the required language runtimes.
|
||||
|
||||
This is used to run static analysis checks during [pre-commit](#pre-commit) and
|
||||
for any local, non-Docker development or testing.
|
||||
@@ -166,21 +172,22 @@ pip: `pip install pre-commit`.
|
||||
|
||||
### Elixir Development
|
||||
|
||||
If you are interested in contributing to the Web Application/API, please read the
|
||||
detailed info found in the [Elixir Developer Guide](elixir/README.md)
|
||||
If you are interested in contributing to the Web Application/API, please read
|
||||
the detailed info found in the [Elixir Developer Guide](elixir/README.md)
|
||||
|
||||
### Rust Development
|
||||
|
||||
If you are interested in contributing to the Gateway, Relay, or client library,
|
||||
please read the detailed info found in the [Rust Developer Guide](rust/README.md)
|
||||
please read the detailed info found in the
|
||||
[Rust Developer Guide](rust/README.md)
|
||||
|
||||
## Reporting Bugs
|
||||
|
||||
We appreciate any and all bug reports.
|
||||
|
||||
To report a bug, please first [search for it in our issues
|
||||
tracker](https://github.com/firezone/firezone/issues). Be sure to search closed
|
||||
issues as well.
|
||||
To report a bug, please first
|
||||
[search for it in our issues tracker](https://github.com/firezone/firezone/issues).
|
||||
Be sure to search closed issues as well.
|
||||
|
||||
If it's not there, please open a new issue and include the following:
|
||||
|
||||
@@ -202,15 +209,15 @@ swiftly, please read the below _before_ opening a pull request.
|
||||
|
||||
Please test your code. As a contributor, it is **your** responsibility to ensure
|
||||
your code is bug-free, otherwise it may be rejected. It's also a good idea to
|
||||
check the code coverage report to ensure your tests are covering your new
|
||||
code. E.g.
|
||||
check the code coverage report to ensure your tests are covering your new code.
|
||||
E.g.
|
||||
|
||||
#### Unit Tests
|
||||
|
||||
Unit tests can be run with `mix test` from the project root.
|
||||
|
||||
To view line coverage information, you may run `mix coveralls.html`
|
||||
which will generate an HTML coverage report in `cover/`.
|
||||
To view line coverage information, you may run `mix coveralls.html` which will
|
||||
generate an HTML coverage report in `cover/`.
|
||||
|
||||
#### End-to-end Tests
|
||||
|
||||
@@ -222,7 +229,8 @@ be manually triggered by a reviewer.
|
||||
|
||||
This will help tremendously during our release engineering process.
|
||||
|
||||
Please use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification)
|
||||
Please use the
|
||||
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification)
|
||||
standard to write your commit message.
|
||||
|
||||
E.g.
|
||||
@@ -248,4 +256,5 @@ pre-commit run --all-files
|
||||
|
||||
## Asking For Help
|
||||
|
||||
If you get stuck, don't hesitate to ask for help on our [community forums](https://discourse.firez.one/?utm_source=contributing).
|
||||
If you get stuck, don't hesitate to ask for help on our
|
||||
[community forums](https://discourse.firez.one/?utm_source=contributing).
|
||||
|
||||
@@ -3,7 +3,7 @@ defmodule Web.Auth do
|
||||
alias Domain.Auth
|
||||
|
||||
def signed_in_path(%Auth.Subject{actor: %{type: :account_admin_user}} = subject) do
|
||||
~p"/#{subject.account.slug || subject.account}/dashboard"
|
||||
~p"/#{subject.account.slug || subject.account}/actors"
|
||||
end
|
||||
|
||||
def put_subject_in_session(conn, %Auth.Subject{} = subject) do
|
||||
@@ -18,7 +18,7 @@ defmodule Web.Auth do
|
||||
@doc """
|
||||
Redirects the signed in user depending on the actor type.
|
||||
|
||||
The account admin users are sent to dashboard or a return path if it's stored in session.
|
||||
The account admin users are sent to authenticated home or a return path if it's stored in session.
|
||||
|
||||
The account users are only expected to authenticate using client apps.
|
||||
If the platform is known, we direct them to the application through a deep link or an app link;
|
||||
@@ -56,7 +56,7 @@ defmodule Web.Auth do
|
||||
:info,
|
||||
"Please use a client application to access Firezone."
|
||||
)
|
||||
|> Phoenix.Controller.redirect(to: ~p"/#{conn.path_params["account_id_or_slug"]}/")
|
||||
|> Phoenix.Controller.redirect(to: ~p"/#{conn.path_params["account_id_or_slug"]}")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -81,7 +81,7 @@ defmodule Web.Auth do
|
||||
:info,
|
||||
"Please use a client application to access Firezone."
|
||||
)
|
||||
|> Phoenix.Controller.redirect(to: ~p"/#{conn.path_params["account_id_or_slug"]}/")
|
||||
|> Phoenix.Controller.redirect(to: ~p"/#{conn.path_params["account_id_or_slug"]}")
|
||||
end
|
||||
|
||||
@doc """
|
||||
@@ -173,7 +173,7 @@ defmodule Web.Auth do
|
||||
conn
|
||||
|> Phoenix.Controller.put_flash(:error, "You must log in to access this page.")
|
||||
|> maybe_store_return_to()
|
||||
|> Phoenix.Controller.redirect(to: ~p"/#{conn.path_params["account_id_or_slug"]}/sign_in")
|
||||
|> Phoenix.Controller.redirect(to: ~p"/#{conn.path_params["account_id_or_slug"]}")
|
||||
|> Plug.Conn.halt()
|
||||
end
|
||||
end
|
||||
@@ -260,7 +260,7 @@ defmodule Web.Auth do
|
||||
socket =
|
||||
socket
|
||||
|> Phoenix.LiveView.put_flash(:error, "You must log in to access this page.")
|
||||
|> Phoenix.LiveView.redirect(to: ~p"/#{params["account_id_or_slug"]}/sign_in")
|
||||
|> Phoenix.LiveView.redirect(to: ~p"/#{params["account_id_or_slug"]}")
|
||||
|
||||
{:halt, socket}
|
||||
end
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
<.topbar subject={@subject} />
|
||||
|
||||
<.sidebar>
|
||||
<.sidebar_item
|
||||
current_path={@current_path}
|
||||
navigate={~p"/#{@account}/dashboard"}
|
||||
icon="hero-chart-bar-square-solid"
|
||||
>
|
||||
Dashboard
|
||||
</.sidebar_item>
|
||||
|
||||
<.sidebar_item
|
||||
current_path={@current_path}
|
||||
navigate={~p"/#{@account}/actors"}
|
||||
|
||||
@@ -239,8 +239,6 @@ defmodule Web.NavigationComponents do
|
||||
default: nil,
|
||||
doc: "Account assign which will be used to fetch the home path."
|
||||
|
||||
# TODO: remove this attribute
|
||||
attr :home_path, :string, required: false, doc: "The path for to the home page for a user."
|
||||
slot :inner_block, required: true, doc: "Breadcrumb entries"
|
||||
|
||||
def breadcrumbs(assigns) do
|
||||
@@ -249,7 +247,7 @@ defmodule Web.NavigationComponents do
|
||||
<ol class="inline-flex items-center space-x-1 md:space-x-2">
|
||||
<li class="inline-flex items-center">
|
||||
<.link
|
||||
navigate={if @account, do: ~p"/#{@account}/dashboard", else: @home_path}
|
||||
navigate={if @account, do: ~p"/#{@account}/actors", else: @home_path}
|
||||
class="inline-flex items-center text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white"
|
||||
>
|
||||
<.icon name="hero-home-solid" class="w-4 h-4 mr-2" /> Home
|
||||
|
||||
@@ -60,14 +60,14 @@ defmodule Web.AuthController do
|
||||
{:error, :not_found} ->
|
||||
conn
|
||||
|> put_flash(:userpass_provider_identifier, String.slice(provider_identifier, 0, 160))
|
||||
|> put_flash(:error, "You can not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> put_flash(:error, "You may not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
|
||||
{:error, _reason} ->
|
||||
conn
|
||||
|> put_flash(:userpass_provider_identifier, String.slice(provider_identifier, 0, 160))
|
||||
|> put_flash(:error, "Invalid username or password.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -165,13 +165,13 @@ defmodule Web.AuthController do
|
||||
else
|
||||
{:error, :not_found} ->
|
||||
conn
|
||||
|> put_flash(:error, "You can not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> put_flash(:error, "You may not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
|
||||
{:error, _reason} ->
|
||||
conn
|
||||
|> put_flash(:error, "The sign in link is invalid or expired.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -197,8 +197,8 @@ defmodule Web.AuthController do
|
||||
else
|
||||
{:error, :not_found} ->
|
||||
conn
|
||||
|> put_flash(:error, "You can not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> put_flash(:error, "You may not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -245,19 +245,19 @@ defmodule Web.AuthController do
|
||||
else
|
||||
{:error, :not_found} ->
|
||||
conn
|
||||
|> put_flash(:error, "You can not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> put_flash(:error, "You may not use this method to sign in.")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
|
||||
{:error, _reason} ->
|
||||
conn
|
||||
|> put_flash(:error, "You can not authenticate to this account.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> put_flash(:error, "You may not authenticate to this account.")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
end
|
||||
else
|
||||
{:error, :invalid_state, conn} ->
|
||||
conn
|
||||
|> put_flash(:error, "Your session has expired, please try again.")
|
||||
|> redirect(to: "/#{account_id_or_slug}/sign_in")
|
||||
|> redirect(to: "/#{account_id_or_slug}")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -282,7 +282,7 @@ defmodule Web.AuthController do
|
||||
"account_id_or_slug" => account_id_or_slug
|
||||
}) do
|
||||
{:ok, _identity, redirect_url} =
|
||||
Domain.Auth.sign_out(subject.identity, url(~p"/#{account_id_or_slug}/sign_in"))
|
||||
Domain.Auth.sign_out(subject.identity, url(~p"/#{account_id_or_slug}"))
|
||||
|
||||
conn
|
||||
|> delete_recent_account()
|
||||
@@ -293,7 +293,7 @@ defmodule Web.AuthController do
|
||||
def sign_out(conn, %{"account_id_or_slug" => account_id_or_slug}) do
|
||||
conn
|
||||
|> Auth.sign_out()
|
||||
|> redirect(to: ~p"/#{account_id_or_slug}/sign_in")
|
||||
|> redirect(to: ~p"/#{account_id_or_slug}")
|
||||
end
|
||||
|
||||
defp delete_recent_account(%{assigns: %{subject: subject}} = conn) do
|
||||
|
||||
@@ -45,7 +45,7 @@ defmodule Web.Actors.Edit do
|
||||
put_flash(socket, :error, "You don't have permissions to perform this action.")}
|
||||
|
||||
{:error, :cant_remove_admin_type} ->
|
||||
{:noreply, put_flash(socket, :error, "You can not demote the last admin.")}
|
||||
{:noreply, put_flash(socket, :error, "You may not demote the last admin.")}
|
||||
|
||||
{:error, {:unauthorized, _context}} ->
|
||||
{:noreply,
|
||||
@@ -58,7 +58,7 @@ defmodule Web.Actors.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/actors"}>Actors</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/#{@actor}"}>
|
||||
<%= @actor.name %>
|
||||
|
||||
@@ -15,7 +15,7 @@ defmodule Web.Actors.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/actors"}>Actors</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/new"}>Add</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
@@ -60,7 +60,7 @@ defmodule Web.Actors.ServiceAccounts.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/actors"}>Actors</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/new"}>Add</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/service_accounts/new"}>Service Account</.breadcrumb>
|
||||
|
||||
@@ -65,7 +65,7 @@ defmodule Web.Actors.ServiceAccounts.NewIdentity do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/actors"}>Actors</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/#{@actor}"}>
|
||||
<%= @actor.name %>
|
||||
|
||||
@@ -58,7 +58,7 @@ defmodule Web.Actors.Users.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/actors"}>Actors</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/new"}>Add</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/users/new"}>User</.breadcrumb>
|
||||
|
||||
@@ -64,7 +64,7 @@ defmodule Web.Actors.Users.NewIdentity do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/actors"}>Actors</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/actors/#{@actor}"}>
|
||||
<%= @actor.name %>
|
||||
|
||||
@@ -38,8 +38,8 @@ defmodule Web.Auth.SignIn do
|
||||
|
||||
<div class="w-full col-span-6 mx-auto bg-white rounded-lg shadow dark:bg-gray-800 md:mt-0 sm:max-w-lg xl:p-0">
|
||||
<div class="p-6 space-y-4 lg:space-y-6 sm:p-8">
|
||||
<h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 sm:text-2xl dark:text-white">
|
||||
Welcome back
|
||||
<h1 class="text-xl text-center font-bold leading-tight tracking-tight text-gray-900 sm:text-2xl dark:text-white">
|
||||
<%= @account.name %> Admin Portal
|
||||
</h1>
|
||||
|
||||
<.flash flash={@flash} kind={:error} />
|
||||
@@ -89,6 +89,20 @@ defmodule Web.Auth.SignIn do
|
||||
</.intersperse_blocks>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mx-auto p-6 sm:p-8">
|
||||
<p class="py-2">
|
||||
Don't have an account?
|
||||
<a href={~p"/sign_up"} class="font-medium text-blue-600 hover:text-blue-500">
|
||||
Sign up here.
|
||||
</a>
|
||||
</p>
|
||||
<p class="py-2">
|
||||
<%= # TODO: Add link to client instructions docs %> Meant to sign in from a client instead?
|
||||
<a href="https://firezone.dev/docs" class="font-medium text-blue-600 hover:text-blue-500">
|
||||
Read the docs.
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
"""
|
||||
@@ -201,7 +215,7 @@ defmodule Web.Auth.SignIn do
|
||||
focus:z-10 focus:ring-4 focus:ring-gray-200
|
||||
dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400
|
||||
dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700]}>
|
||||
Log in with <%= @provider.name %>
|
||||
Sign in with <%= @provider.name %>
|
||||
</a>
|
||||
"""
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ defmodule Web.Clients.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/clients"}>Clients</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/clients/#{@client}"}>
|
||||
<%= @client.name %>
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule Web.Clients.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/clients"}>Clients</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<.header>
|
||||
|
||||
@@ -22,7 +22,7 @@ defmodule Web.Clients.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/clients"}>Clients</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/clients/#{@client.id}"}>
|
||||
<%= @client.name %>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
defmodule Web.Dashboard do
|
||||
use Web, :live_view
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<div class="grid grid-cols-1 p-4 xl:grid-cols-3 xl:gap-4 dark:bg-gray-900">
|
||||
<div class="col-span-full mb-4 xl:mb-2">
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl dark:text-white">Dashboard</h1>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
end
|
||||
@@ -47,7 +47,7 @@ defmodule Web.GatewayGroups.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups"}>Gateway Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups/#{@group}"}>
|
||||
<%= @group.name_prefix %>
|
||||
|
||||
@@ -22,7 +22,7 @@ defmodule Web.GatewayGroups.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups"}>Gateway Instance Groups</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<.header>
|
||||
|
||||
@@ -52,7 +52,7 @@ defmodule Web.GatewayGroups.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups"}>Gateway Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups/new"}>Add</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
@@ -33,7 +33,7 @@ defmodule Web.GatewayGroups.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups"}>Gateway Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups/#{@group}"}>
|
||||
<%= @group.name_prefix %>
|
||||
|
||||
@@ -47,7 +47,7 @@ defmodule Web.Gateways.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups"}>Gateway Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/gateway_groups/#{@gateway.group}"}>
|
||||
<%= @gateway.group.name_prefix %>
|
||||
|
||||
@@ -34,7 +34,7 @@ defmodule Web.Groups.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/groups"}>Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/groups/#{@group}"}>
|
||||
<%= @group.name %>
|
||||
|
||||
@@ -72,7 +72,7 @@ defmodule Web.Groups.EditActors do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/groups"}>Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/groups/#{@group}"}>
|
||||
<%= @group.name %>
|
||||
|
||||
@@ -22,7 +22,7 @@ defmodule Web.Groups.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/groups"}><%= @page_title %></.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ defmodule Web.Groups.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/groups"}>Actor Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/groups/new"}>Add</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
@@ -26,7 +26,7 @@ defmodule Web.Groups.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/groups"}>Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/groups/#{@group}"}>
|
||||
<%= @group.name %>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
defmodule Web.Landing do
|
||||
use Web, {:live_view, layout: {Web.Layouts, :public}}
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
Home page for unauthenticated users and regular account users with app download links.
|
||||
"""
|
||||
end
|
||||
end
|
||||
@@ -18,7 +18,7 @@ defmodule Web.Policies.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/policies"}>Policies</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/policies/#{@policy}"}>
|
||||
<.policy_name policy={@policy} />
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule Web.Policies.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/policies"}>Policies</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<.header>
|
||||
|
||||
@@ -23,7 +23,7 @@ defmodule Web.Policies.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/policies"}>Policies</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/policies/new"}>Add Policy</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
@@ -24,7 +24,7 @@ defmodule Web.Policies.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/policies"}>Policies</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/policies/#{@policy}"}>
|
||||
<.policy_name policy={@policy} />
|
||||
|
||||
@@ -32,7 +32,7 @@ defmodule Web.RelayGroups.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups"}>Relay Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups/#{@group}"}>
|
||||
<%= @group.name %>
|
||||
|
||||
@@ -22,7 +22,7 @@ defmodule Web.RelayGroups.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups"}>Relay Instance Groups</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<.header>
|
||||
|
||||
@@ -39,7 +39,7 @@ defmodule Web.RelayGroups.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups"}>Relay Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups/new"}>Add</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
@@ -32,7 +32,7 @@ defmodule Web.RelayGroups.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups"}>Relay Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups/#{@group}"}>
|
||||
<%= @group.name %>
|
||||
|
||||
@@ -40,7 +40,7 @@ defmodule Web.Relays.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups"}>Relay Instance Groups</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/relay_groups/#{@relay.group}"}>
|
||||
<%= @relay.group.name %>
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Resources.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/resources"}>Resources</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/resources/#{@resource.id}"}>
|
||||
<%= @resource.name %>
|
||||
|
||||
@@ -14,7 +14,7 @@ defmodule Web.Resources.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/resources"}>Resources</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<.header>
|
||||
|
||||
@@ -20,7 +20,7 @@ defmodule Web.Resources.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/resources"}>Resources</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/resources/new"}>Add Resource</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
|
||||
@@ -39,7 +39,7 @@ defmodule Web.Resources.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/resources"}>Resources</.breadcrumb>
|
||||
<.breadcrumb path={~p"/#{@account}/resources/#{@resource.id}"}>
|
||||
<%= @resource.name %>
|
||||
|
||||
@@ -3,7 +3,7 @@ defmodule Web.Settings.Account do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/account"}>Account Settings</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<!-- Account Settings -->
|
||||
|
||||
@@ -3,7 +3,7 @@ defmodule Web.Settings.DNS do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/dns"}>DNS Settings</.breadcrumb>
|
||||
</.breadcrumbs>
|
||||
<.header>
|
||||
|
||||
@@ -96,7 +96,7 @@ defmodule Web.Settings.IdentityProviders.GoogleWorkspace.Connect do
|
||||
|
||||
{:error, _reason} ->
|
||||
conn
|
||||
|> put_flash(:error, "You can not authenticate to this account.")
|
||||
|> put_flash(:error, "You may not authenticate to this account.")
|
||||
|> redirect(
|
||||
to: ~p"/#{account}/settings/identity_providers/google_workspace/#{provider_id}"
|
||||
)
|
||||
|
||||
@@ -45,7 +45,7 @@ defmodule Web.Settings.IdentityProviders.GoogleWorkspace.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -64,7 +64,7 @@ defmodule Web.Settings.IdentityProviders.GoogleWorkspace.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -45,7 +45,7 @@ defmodule Web.Settings.IdentityProviders.GoogleWorkspace.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -26,7 +26,7 @@ defmodule Web.Settings.IdentityProviders.Index do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Settings.IdentityProviders.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -45,7 +45,7 @@ defmodule Web.Settings.IdentityProviders.OpenIDConnect.Edit do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -64,7 +64,7 @@ defmodule Web.Settings.IdentityProviders.OpenIDConnect.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -45,7 +45,7 @@ defmodule Web.Settings.IdentityProviders.OpenIDConnect.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -36,7 +36,7 @@ defmodule Web.Settings.IdentityProviders.SAML.New do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -20,7 +20,7 @@ defmodule Web.Settings.IdentityProviders.SAML.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -45,7 +45,7 @@ defmodule Web.Settings.IdentityProviders.System.Show do
|
||||
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.breadcrumbs home_path={~p"/#{@account}/dashboard"}>
|
||||
<.breadcrumbs account={@account}>
|
||||
<.breadcrumb path={~p"/#{@account}/settings/identity_providers"}>
|
||||
Identity Providers Settings
|
||||
</.breadcrumb>
|
||||
|
||||
@@ -122,9 +122,9 @@ defmodule Web.SignUp do
|
||||
<div>
|
||||
<.link
|
||||
class="font-medium text-blue-600 dark:text-blue-500 hover:underline"
|
||||
navigate={~p"/#{@account.slug}/sign_in"}
|
||||
navigate={~p"/#{@account.slug}"}
|
||||
>
|
||||
<%= "#{Web.Endpoint.url()}/#{@account.slug}/sign_in" %>
|
||||
<%= "#{Web.Endpoint.url()}/#{@account.slug}" %>
|
||||
</.link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -52,7 +52,7 @@ defmodule Web.Router do
|
||||
live "/", SignUp
|
||||
end
|
||||
|
||||
scope "/:account_id_or_slug/sign_in", Web do
|
||||
scope "/:account_id_or_slug", Web do
|
||||
pipe_through [:browser, :redirect_if_user_is_authenticated]
|
||||
|
||||
live_session :redirect_if_user_is_authenticated,
|
||||
@@ -64,10 +64,10 @@ defmodule Web.Router do
|
||||
|
||||
# Adapter-specific routes
|
||||
## Email
|
||||
live "/providers/email/:provider_id", Auth.Email
|
||||
live "/sign_in/providers/email/:provider_id", Auth.Email
|
||||
end
|
||||
|
||||
scope "/providers/:provider_id" do
|
||||
scope "/sign_in/providers/:provider_id" do
|
||||
# UserPass
|
||||
post "/verify_credentials", AuthController, :verify_credentials
|
||||
|
||||
@@ -98,8 +98,6 @@ defmodule Web.Router do
|
||||
{Web.Auth, :mount_account},
|
||||
{Web.Nav, :set_active_sidebar_item}
|
||||
] do
|
||||
live "/dashboard", Dashboard
|
||||
|
||||
scope "/actors", Actors do
|
||||
live "/", Index
|
||||
live "/new", New
|
||||
@@ -212,14 +210,4 @@ defmodule Web.Router do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
scope "/", Web do
|
||||
pipe_through [:browser]
|
||||
|
||||
live_session :landing,
|
||||
on_mount: [Web.Sandbox] do
|
||||
live "/:account_id_or_slug/", Landing
|
||||
live "/", Landing
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ defmodule Web.Acceptance.Auth.EmailTest do
|
||||
Fixtures.Auth.create_email_provider(account: account)
|
||||
|
||||
session
|
||||
|> visit(~p"/#{account}/sign_in")
|
||||
|> visit(~p"/#{account}")
|
||||
|> assert_el(Query.text("Sign in with a magic link"))
|
||||
|> fill_form(%{
|
||||
"email[provider_identifier]" => "foo@bar.com"
|
||||
@@ -33,13 +33,13 @@ defmodule Web.Acceptance.Auth.EmailTest do
|
||||
session
|
||||
|> email_login_flow(account, identity.provider_identifier)
|
||||
|> assert_el(Query.css("#user-menu-button"))
|
||||
|> assert_path(~p"/#{account.slug}/dashboard")
|
||||
|> assert_path(~p"/#{account.slug}/actors")
|
||||
|> Auth.assert_authenticated(identity)
|
||||
end
|
||||
|
||||
defp email_login_flow(session, account, email) do
|
||||
session
|
||||
|> visit(~p"/#{account}/sign_in")
|
||||
|> visit(~p"/#{account}")
|
||||
|> assert_el(Query.text("Sign in with a magic link"))
|
||||
|> fill_form(%{
|
||||
"email[provider_identifier]" => email
|
||||
|
||||
@@ -12,13 +12,13 @@ defmodule Web.Acceptance.Auth.OpenIDConnectTest do
|
||||
{:ok, _entity_id} = Vault.upsert_user(oidc_login, email, oidc_password)
|
||||
|
||||
session
|
||||
|> visit(~p"/#{account}/sign_in")
|
||||
|> assert_el(Query.text("Welcome back"))
|
||||
|> click(Query.link("Log in with Vault"))
|
||||
|> visit(~p"/#{account}")
|
||||
|> assert_el(Query.text("#{account.name} Admin Portal"))
|
||||
|> click(Query.link("Sign in with Vault"))
|
||||
|> Vault.userpass_flow(oidc_login, oidc_password)
|
||||
|> assert_el(Query.text("Welcome back"))
|
||||
|> assert_path(~p"/#{account}/sign_in")
|
||||
|> assert_el(Query.text("You can not authenticate to this account."))
|
||||
|> assert_el(Query.text("#{account.name} Admin Portal"))
|
||||
|> assert_path(~p"/#{account}")
|
||||
|> assert_el(Query.text("You may not authenticate to this account."))
|
||||
end
|
||||
|
||||
feature "authenticates existing user", %{session: session} do
|
||||
@@ -40,12 +40,12 @@ defmodule Web.Acceptance.Auth.OpenIDConnectTest do
|
||||
)
|
||||
|
||||
session
|
||||
|> visit(~p"/#{account}/sign_in")
|
||||
|> assert_el(Query.text("Welcome back"))
|
||||
|> click(Query.link("Log in with Vault"))
|
||||
|> visit(~p"/#{account}")
|
||||
|> assert_el(Query.text("#{account.name} Admin Portal"))
|
||||
|> click(Query.link("Sign in with Vault"))
|
||||
|> Vault.userpass_flow(oidc_login, oidc_password)
|
||||
|> assert_el(Query.css("#user-menu-button"))
|
||||
|> Auth.assert_authenticated(identity)
|
||||
|> assert_path(~p"/#{account.slug}/dashboard")
|
||||
|> assert_path(~p"/#{account.slug}/actors")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -94,7 +94,7 @@ defmodule Web.Acceptance.Auth.UserPassTest do
|
||||
|> assert_error_flash("Invalid username or password.")
|
||||
end
|
||||
|
||||
feature "redirects to dashboard after successful log in as account_admin_user", %{
|
||||
feature "redirects to actors index after successful log in as account_admin_user", %{
|
||||
session: session
|
||||
} do
|
||||
account = Fixtures.Accounts.create_account()
|
||||
@@ -112,11 +112,11 @@ defmodule Web.Acceptance.Auth.UserPassTest do
|
||||
session
|
||||
|> password_login_flow(account, identity.provider_identifier, password)
|
||||
|> assert_el(Query.css("#user-menu-button"))
|
||||
|> assert_path(~p"/#{account.slug}/dashboard")
|
||||
|> assert_path(~p"/#{account.slug}/actors")
|
||||
|> Auth.assert_authenticated(identity)
|
||||
end
|
||||
|
||||
feature "redirects to landing page after successful log in as account_user", %{
|
||||
feature "redirects back to sign_in page after successful log in as account_user", %{
|
||||
session: session
|
||||
} do
|
||||
account = Fixtures.Accounts.create_account()
|
||||
@@ -133,13 +133,13 @@ defmodule Web.Acceptance.Auth.UserPassTest do
|
||||
|
||||
session
|
||||
|> password_login_flow(account, identity.provider_identifier, password)
|
||||
|> assert_path(~p"/#{account}/")
|
||||
|> assert_path(~p"/#{account}")
|
||||
end
|
||||
|
||||
defp password_login_flow(session, account, username, password) do
|
||||
session
|
||||
|> visit(~p"/#{account}/sign_in")
|
||||
|> assert_el(Query.text("Welcome back"))
|
||||
|> visit(~p"/#{account}")
|
||||
|> assert_el(Query.text("#{account.name} Admin Portal"))
|
||||
|> assert_el(Query.text("Sign in with username and password"))
|
||||
|> fill_form(%{
|
||||
"userpass[provider_identifier]" => username,
|
||||
|
||||
@@ -14,9 +14,9 @@ defmodule Web.Acceptance.AuthTest do
|
||||
Fixtures.Auth.start_and_create_openid_connect_provider(account: account)
|
||||
|
||||
session
|
||||
|> visit(~p"/#{account}/sign_in")
|
||||
|> assert_el(Query.text("Welcome back"))
|
||||
|> assert_el(Query.link("Log in with #{openid_connect_provider.name}"))
|
||||
|> visit(~p"/#{account}")
|
||||
|> assert_el(Query.text("#{account.name} Admin Portal"))
|
||||
|> assert_el(Query.link("Sign in with #{openid_connect_provider.name}"))
|
||||
|> assert_el(Query.text("Sign in with username and password"))
|
||||
|> assert_el(Query.text("Sign in with a magic link"))
|
||||
end
|
||||
@@ -38,13 +38,13 @@ defmodule Web.Acceptance.AuthTest do
|
||||
session
|
||||
|> visit(~p"/#{account}")
|
||||
|> Auth.authenticate(identity)
|
||||
|> visit(~p"/#{account}/dashboard")
|
||||
|> visit(~p"/#{account}/actors")
|
||||
|> assert_el(Query.css("#user-menu-button"))
|
||||
|> click(Query.css("#user-menu-button"))
|
||||
|> click(Query.link("Sign out"))
|
||||
|> assert_el(Query.text("Sign in with username and password"))
|
||||
|> Auth.assert_unauthenticated()
|
||||
|> assert_path(~p"/#{account}/sign_in")
|
||||
|> assert_path(~p"/#{account}")
|
||||
end
|
||||
|
||||
feature "signs out unprivileged user", %{session: session} do
|
||||
@@ -66,7 +66,7 @@ defmodule Web.Acceptance.AuthTest do
|
||||
|> visit(~p"/#{account}/sign_out")
|
||||
|> assert_el(Query.text("Sign in with username and password"))
|
||||
|> Auth.assert_unauthenticated()
|
||||
|> assert_path(~p"/#{account}/sign_in")
|
||||
|> assert_path(~p"/#{account}")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,10 +87,10 @@ defmodule Web.Acceptance.AuthTest do
|
||||
session
|
||||
|> visit(~p"/#{account}")
|
||||
|> Auth.authenticate(identity)
|
||||
|> visit(~p"/#{account}/dashboard")
|
||||
|> visit(~p"/#{account}/actors")
|
||||
|
||||
assert text(session) == "Not Found"
|
||||
|
||||
assert_path(session, ~p"/#{account}/dashboard")
|
||||
assert_path(session, ~p"/#{account}/actors")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,8 +25,8 @@ defmodule Web.AuthTest do
|
||||
end
|
||||
|
||||
describe "signed_in_path/1" do
|
||||
test "redirects to dashboard after sign in as account admin", %{admin_subject: subject} do
|
||||
assert signed_in_path(subject) == ~p"/#{subject.account.slug}/dashboard"
|
||||
test "redirects to actors index after sign in as account admin", %{admin_subject: subject} do
|
||||
assert signed_in_path(subject) == ~p"/#{subject.account.slug}/actors"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -179,7 +179,7 @@ defmodule Web.AuthTest do
|
||||
|> ensure_authenticated([])
|
||||
|
||||
assert conn.halted
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}"
|
||||
|
||||
assert Phoenix.Flash.get(conn.assigns.flash, :error) ==
|
||||
"You must log in to access this page."
|
||||
@@ -349,7 +349,7 @@ defmodule Web.AuthTest do
|
||||
|
||||
assert is_nil(updated_socket.assigns.subject)
|
||||
|
||||
assert updated_socket.redirected == {:redirect, %{to: ~p"/#{subject.account.slug}/sign_in"}}
|
||||
assert updated_socket.redirected == {:redirect, %{to: ~p"/#{subject.account.slug}"}}
|
||||
end
|
||||
|
||||
test "redirects to login page if there isn't a session_token", %{
|
||||
@@ -365,7 +365,7 @@ defmodule Web.AuthTest do
|
||||
|
||||
assert is_nil(updated_socket.assigns.subject)
|
||||
|
||||
assert updated_socket.redirected == {:redirect, %{to: ~p"/#{subject.account.slug}/sign_in"}}
|
||||
assert updated_socket.redirected == {:redirect, %{to: ~p"/#{subject.account.slug}"}}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -404,7 +404,7 @@ defmodule Web.AuthTest do
|
||||
on_mount(:redirect_if_user_is_authenticated, params, session, socket)
|
||||
|
||||
assert updated_socket.redirected ==
|
||||
{:redirect, %{to: ~p"/#{subject.account.slug}/dashboard"}}
|
||||
{:redirect, %{to: ~p"/#{subject.account.slug}/actors"}}
|
||||
end
|
||||
|
||||
test "doesn't redirect if there is no authenticated user", %{
|
||||
|
||||
@@ -19,8 +19,8 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == "/#{account_id}/sign_in"
|
||||
assert flash(conn, :error) == "You can not use this method to sign in."
|
||||
assert redirected_to(conn) == "/#{account_id}"
|
||||
assert flash(conn, :error) == "You may not use this method to sign in."
|
||||
end
|
||||
|
||||
test "redirects back to the form when identity does not exist", %{conn: conn} do
|
||||
@@ -38,7 +38,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == "/#{provider.account_id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{provider.account_id}"
|
||||
assert flash(conn, :error) == "Invalid username or password."
|
||||
assert flash(conn, :userpass_provider_identifier) == "foo"
|
||||
end
|
||||
@@ -69,7 +69,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == "/#{account.id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{account.id}"
|
||||
assert flash(conn, :error) == "Invalid username or password."
|
||||
assert flash(conn, :userpass_provider_identifier) == identity.provider_identifier
|
||||
end
|
||||
@@ -90,7 +90,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == "/#{provider.account_id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{provider.account_id}"
|
||||
assert flash(conn, :error) == "Invalid username or password."
|
||||
|
||||
assert flash(conn, :userpass_provider_identifier) ==
|
||||
@@ -135,7 +135,7 @@ defmodule Web.AuthControllerTest do
|
||||
assert is_nil(get_session(conn, :user_return_to))
|
||||
end
|
||||
|
||||
test "redirects to the dashboard when credentials are valid and return path is empty", %{
|
||||
test "redirects to the actors index when credentials are valid and return path is empty", %{
|
||||
conn: conn
|
||||
} do
|
||||
account = Fixtures.Accounts.create_account()
|
||||
@@ -162,7 +162,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/dashboard"
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/actors"
|
||||
end
|
||||
|
||||
test "renews the session when credentials are valid", %{conn: conn} do
|
||||
@@ -307,7 +307,7 @@ defmodule Web.AuthControllerTest do
|
||||
"info" => "Please use a client application to access Firezone."
|
||||
}
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account.id}/"
|
||||
assert redirected_to(conn) == ~p"/#{account.id}"
|
||||
assert is_nil(get_session(conn, :user_return_to))
|
||||
end
|
||||
|
||||
@@ -461,8 +461,8 @@ defmodule Web.AuthControllerTest do
|
||||
"secret" => "foo"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == "/#{account_id}/sign_in"
|
||||
assert flash(conn, :error) == "You can not use this method to sign in."
|
||||
assert redirected_to(conn) == "/#{account_id}"
|
||||
assert flash(conn, :error) == "You may not use this method to sign in."
|
||||
end
|
||||
|
||||
test "redirects back to the form when identity does not exist", %{conn: conn} do
|
||||
@@ -478,7 +478,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == "/#{provider.account_id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{provider.account_id}"
|
||||
assert flash(conn, :error) == "The sign in link is invalid or expired."
|
||||
end
|
||||
|
||||
@@ -493,7 +493,7 @@ defmodule Web.AuthControllerTest do
|
||||
"secret" => "bar"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
assert flash(conn, :error) == "The sign in link is invalid or expired."
|
||||
end
|
||||
|
||||
@@ -524,7 +524,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
assert flash(conn, :error) == "The sign in link is invalid or expired."
|
||||
end
|
||||
|
||||
@@ -554,7 +554,7 @@ defmodule Web.AuthControllerTest do
|
||||
}
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
assert flash(conn, :error) == "The sign in link is invalid or expired."
|
||||
end
|
||||
|
||||
@@ -622,7 +622,7 @@ defmodule Web.AuthControllerTest do
|
||||
assert is_nil(get_session(conn, :user_return_to))
|
||||
end
|
||||
|
||||
test "redirects to the dashboard when credentials are valid and return path is empty", %{
|
||||
test "redirects to the actors index when credentials are valid and return path is empty", %{
|
||||
conn: conn
|
||||
} do
|
||||
account = Fixtures.Accounts.create_account()
|
||||
@@ -645,7 +645,7 @@ defmodule Web.AuthControllerTest do
|
||||
"secret" => email_token
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/dashboard"
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/actors"
|
||||
end
|
||||
|
||||
test "redirects to the platform link when credentials are valid for account users", %{
|
||||
@@ -800,8 +800,8 @@ defmodule Web.AuthControllerTest do
|
||||
|
||||
conn = get(conn, ~p"/#{account_id}/sign_in/providers/#{provider_id}/redirect")
|
||||
|
||||
assert redirected_to(conn) == "/#{account_id}/sign_in"
|
||||
assert flash(conn, :error) == "You can not use this method to sign in."
|
||||
assert redirected_to(conn) == "/#{account_id}"
|
||||
assert flash(conn, :error) == "You may not use this method to sign in."
|
||||
end
|
||||
|
||||
test "redirects to IdP when provider exists", %{conn: conn} do
|
||||
@@ -876,7 +876,7 @@ defmodule Web.AuthControllerTest do
|
||||
"code" => "bar"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == "/#{account_id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{account_id}"
|
||||
assert flash(conn, :error) == "Your session has expired, please try again."
|
||||
end
|
||||
|
||||
@@ -899,7 +899,7 @@ defmodule Web.AuthControllerTest do
|
||||
"code" => "bar"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
assert flash(conn, :error) == "Your session has expired, please try again."
|
||||
end
|
||||
|
||||
@@ -933,11 +933,11 @@ defmodule Web.AuthControllerTest do
|
||||
"code" => "bar"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert flash(conn, :error) == "You can not use this method to sign in."
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
assert flash(conn, :error) == "You may not use this method to sign in."
|
||||
end
|
||||
|
||||
test "redirects to the dashboard when credentials are valid and return path is empty", %{
|
||||
test "redirects to the actors index when credentials are valid and return path is empty", %{
|
||||
account: account,
|
||||
provider: provider,
|
||||
bypass: bypass,
|
||||
@@ -970,7 +970,7 @@ defmodule Web.AuthControllerTest do
|
||||
"code" => "MyFakeCode"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/dashboard"
|
||||
assert redirected_to(conn) == ~p"/#{account.slug}/actors"
|
||||
|
||||
assert %{
|
||||
"live_socket_id" => "actors_sessions:" <> socket_id,
|
||||
@@ -1085,7 +1085,7 @@ defmodule Web.AuthControllerTest do
|
||||
|> put_session(:preferred_locale, "en_US")
|
||||
|> get(~p"/#{account}/sign_out")
|
||||
|
||||
assert redirected_to(conn) == url(~p"/#{account}/sign_in")
|
||||
assert redirected_to(conn) == url(~p"/#{account}")
|
||||
assert conn.private.plug_session == %{"preferred_locale" => "en_US"}
|
||||
|
||||
assert %{"fz_recent_account_ids" => fz_recent_account_ids} = conn.cookies
|
||||
@@ -1105,7 +1105,7 @@ defmodule Web.AuthControllerTest do
|
||||
|> authorize_conn(identity)
|
||||
|> get(~p"/#{account}/sign_out")
|
||||
|
||||
post_redirect_url = URI.encode_www_form(url(~p"/#{account}/sign_in"))
|
||||
post_redirect_url = URI.encode_www_form(url(~p"/#{account}"))
|
||||
|
||||
assert redirect_url = redirected_to(conn)
|
||||
assert redirect_url =~ "https://example.com"
|
||||
@@ -1129,7 +1129,7 @@ defmodule Web.AuthControllerTest do
|
||||
|> put_session(:live_socket_id, live_socket_id)
|
||||
|> get(~p"/#{account}/sign_out")
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
|
||||
assert_receive %Phoenix.Socket.Broadcast{event: "disconnect", topic: ^live_socket_id}
|
||||
end
|
||||
@@ -1172,7 +1172,7 @@ defmodule Web.AuthControllerTest do
|
||||
|> put_session(:preferred_locale, "en_US")
|
||||
|> get(~p"/#{account}/sign_out")
|
||||
|
||||
assert redirected_to(conn) == url(~p"/#{account}/sign_in")
|
||||
assert redirected_to(conn) == url(~p"/#{account}")
|
||||
assert conn.private.plug_session == %{"preferred_locale" => "en_US"}
|
||||
|
||||
assert %{"fz_recent_account_ids" => fz_recent_account_ids} = conn.cookies
|
||||
@@ -1187,7 +1187,7 @@ defmodule Web.AuthControllerTest do
|
||||
|> put_session(:preferred_locale, "en_US")
|
||||
|> get(~p"/#{account}/sign_out")
|
||||
|
||||
assert redirected_to(conn) == ~p"/#{account}/sign_in"
|
||||
assert redirected_to(conn) == ~p"/#{account}"
|
||||
assert conn.private.plug_session == %{"preferred_locale" => "en_US"}
|
||||
|
||||
refute Map.has_key?(conn.cookies, "fz_recent_account_ids")
|
||||
|
||||
@@ -23,7 +23,7 @@ defmodule Web.Live.Actors.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
@@ -173,7 +173,7 @@ defmodule Web.Live.Actors.EditTest do
|
||||
|
||||
assert lv
|
||||
|> form("form", actor: attrs)
|
||||
|> render_submit() =~ "You can not demote the last admin."
|
||||
|> render_submit() =~ "You may not demote the last admin."
|
||||
end
|
||||
|
||||
test "updates an actor on valid attrs", %{
|
||||
@@ -236,7 +236,7 @@ defmodule Web.Live.Actors.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.Actors.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.Actors.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ defmodule Web.Live.Actors.ServiceAccounts.NewIdentityTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ defmodule Web.Live.Actors.ServiceAccount.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ defmodule Web.Live.Actors.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ defmodule Web.Live.Actors.User.NewIdentityTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ defmodule Web.Live.Actors.User.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -8,21 +8,21 @@ defmodule Web.Auth.SignInTest do
|
||||
|
||||
email_provider = Fixtures.Auth.create_email_provider(account: account)
|
||||
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}/sign_in")
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}")
|
||||
|
||||
assert html =~ "Sign in with a magic link"
|
||||
refute html =~ "Sign in with username and password"
|
||||
|
||||
userpass_provider = Fixtures.Auth.create_userpass_provider(account: account)
|
||||
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}/sign_in")
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}")
|
||||
|
||||
assert html =~ "Sign in with username and password"
|
||||
refute html =~ "Vault"
|
||||
|
||||
Fixtures.Auth.start_and_create_openid_connect_provider(name: "Vault", account: account)
|
||||
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}/sign_in")
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}")
|
||||
|
||||
assert html =~ "Vault"
|
||||
|
||||
@@ -36,11 +36,11 @@ defmodule Web.Auth.SignInTest do
|
||||
subject = Fixtures.Auth.create_subject(identity: identity)
|
||||
|
||||
{:ok, _provider} = Domain.Auth.disable_provider(userpass_provider, subject)
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}/sign_in")
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}")
|
||||
refute html =~ "Sign in with username and password"
|
||||
|
||||
{:ok, _provider} = Domain.Auth.delete_provider(email_provider, subject)
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}/sign_in")
|
||||
{:ok, _lv, html} = live(conn, ~p"/#{account}")
|
||||
refute html =~ "Sign in with a magic link"
|
||||
|
||||
assert html =~ "Vault"
|
||||
|
||||
@@ -25,7 +25,7 @@ defmodule Web.Live.Clients.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.Clients.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -27,7 +27,7 @@ defmodule Web.Live.Clients.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ defmodule Web.Live.GatewayGroups.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.GatewayGroups.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Live.GatewayGroups.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ defmodule Web.Live.GatewayGroups.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ defmodule Web.Live.Gateways.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ defmodule Web.Live.Groups.EditActorsTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ defmodule Web.Live.Groups.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.Groups.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Live.Groups.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ defmodule Web.Live.Groups.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -35,7 +35,7 @@ defmodule Web.Live.Policies.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.Policies.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Live.Policies.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -38,7 +38,7 @@ defmodule Web.Live.Policies.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ defmodule Web.Live.RelayGroups.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.RelayGroups.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Live.RelayGroups.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ defmodule Web.Live.RelayGroups.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ defmodule Web.Live.Relays.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ defmodule Web.Live.Resources.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ defmodule Web.Live.Resources.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ defmodule Web.Live.Resources.NewTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -38,7 +38,7 @@ defmodule Web.Live.Resources.ShowTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ defmodule Web.Live.Settings.Account.IndexTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ defmodule Web.Live.Settings.IdentityProviders.GoogleWorkspace.Connect do
|
||||
~p"/#{account_id}/settings/identity_providers/google_workspace/#{provider_id}/redirect"
|
||||
)
|
||||
|
||||
assert redirected_to(conn) == "/#{account_id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{account_id}"
|
||||
assert flash(conn, :error) == "You must log in to access this page."
|
||||
end
|
||||
|
||||
@@ -116,7 +116,7 @@ defmodule Web.Live.Settings.IdentityProviders.GoogleWorkspace.Connect do
|
||||
"code" => "bar"
|
||||
})
|
||||
|
||||
assert redirected_to(conn) == "/#{account_id}/sign_in"
|
||||
assert redirected_to(conn) == "/#{account_id}"
|
||||
assert flash(conn, :error) == "Your session has expired, please try again."
|
||||
end
|
||||
|
||||
@@ -148,7 +148,7 @@ defmodule Web.Live.Settings.IdentityProviders.GoogleWorkspace.Connect do
|
||||
assert flash(conn, :error) == "Your session has expired, please try again."
|
||||
end
|
||||
|
||||
test "redirects to the dashboard when credentials are valid and return path is empty", %{
|
||||
test "redirects to the actors index when credentials are valid and return path is empty", %{
|
||||
account: account,
|
||||
conn: conn
|
||||
} do
|
||||
|
||||
@@ -33,7 +33,7 @@ defmodule Web.Live.Settings.IdentityProviders.GoogleWorkspace.EditTest do
|
||||
{:error,
|
||||
{:redirect,
|
||||
%{
|
||||
to: ~p"/#{account}/sign_in",
|
||||
to: ~p"/#{account}",
|
||||
flash: %{"error" => "You must log in to access this page."}
|
||||
}}}
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user