Skip to content

Instantly share code, notes, and snippets.

View thebrianemory's full-sized avatar

Brian Emory thebrianemory

View GitHub Profile
defmodule Catcasts.Repo.Migrations.AddTokenToUsers do
use Ecto.Migration
def change do
alter table("users") do
add(:token, :string)
end
end
end
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
Tilex.AuthControllerTest
* test GET /auth/google/callback with hashrocket email (16.0ms)
1) test GET /auth/google/callback with hashrocket email (Tilex.AuthControllerTest)
test/controllers/auth_controller_test.exs:6
Assertion with == failed
code: assert get_flash(conn, :info) == "Signed in with developer@hashrocket.com"
left: "developer@hashrocket.com is not a valid email address"
right: "Signed in with developer@hashrocket.com"
stacktrace:
# Configure your database
config :tilex, Tilex.Repo,
adapter: Ecto.Adapters.Postgres,
database: "tilex_test",
hostname: "localhost",
username: "postgres", # Change this line
pool: Ecto.Adapters.SQL.Sandbox
** (Mix) The database for Tilex.Repo couldn't be created: FATAL 28000 (invalid_authorization_specification): role "postgres" does not exist
08:18:21.521 [error] GenServer #PID<0.612.0> terminating
** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification): role "postgres" does not exist
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock"
config :tilex, TilexWeb.Endpoint,
load_from_system_env: true,
url: [scheme: "https", host: "your_app.herokuapp.com", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE")
def project do
[app: :tilex,
version: "0.0.1",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
aliases: aliases(),
deps: deps(),
defp authenticate(%{info: info, uid: uid}) do
email = Map.get(info, :email)
name = Developer.format_username(Map.get(info, :name))
case String.match?(email, ~r/@yourdomain.com$/) do # Add your domain on this line
true ->
attrs = %{
email: email,
username: name,
google_id: uid
config :tilex, TilexWeb.Endpoint,
http: [port: {:system, "PORT"}],
url: [host: System.get_env("HOST"), port: 80],
cache_static_manifest: "priv/static/manifest.json",
secret_key_base: System.get_env("SECRET_KEY_BASE")