This file contains 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
defmodule Catcasts.Repo.Migrations.AddTokenToUsers do | |
use Ecto.Migration | |
def change do | |
alter table("users") do | |
add(:token, :string) | |
end | |
end | |
end |
This file contains 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
[ | |
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"] | |
] |
This file contains 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
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: |
This file contains 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
# 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 |
This file contains 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
** (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 |
This file contains 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
build_path: "../../_build", | |
config_path: "../../config/config.exs", | |
deps_path: "../../deps", | |
lockfile: "../../mix.lock" |
This file contains 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
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") |
This file contains 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
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(), |
This file contains 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
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 |
This file contains 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
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") |
NewerOlder