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
.no-js .top-bar { | |
display: none; | |
} | |
@media screen and (min-width: 40em) { | |
.no-js .top-bar { | |
display: block; | |
} | |
.no-js .title-bar { | |
display: none; | |
} |
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
# Delete the following code | |
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p> | |
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p> |
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
<%= if get_flash(@conn, :info) do %> | |
<div class="callout primary" role="alert" data-closable><%= get_flash(@conn, :info) %> | |
<button class="close-button" aria-label="Dismiss alert" type="button" data-close> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
<% end %> | |
<%= if get_flash(@conn, :error) do %> | |
<div class="callout alert" role="alert" data-closable><%= get_flash(@conn, :error) %> | |
<button class="close-button" aria-label="Dismiss alert" type="button" data-close> |
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
<!DOCTYPE html> | |
... <!-- Code removed for readability --> | |
<body> | |
<div class="container"> | |
<%= render "_navigation.html", conn: @conn %> | |
<%= render "_flash.html", conn: @conn %> | |
... <!-- Code removed for readability --> |
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.AuthControllerTest do | |
use Catcasts.ConnCase | |
test "Sign in with Google", %{conn: conn} do | |
conn = get conn, "/auth/google?scope=email%20profile" | |
assert redirected_to(conn, 302) | |
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
defmodule Catcasts.Mixfile do | |
use Mix.Project | |
... # Code removed for readability | |
# Type `mix help compile.app` for more information. | |
def application do | |
[mod: {Catcasts, []}, | |
applications: [:phoenix, ... # Code removed for readability, | |
:postgrex, :ueberauth, :ueberauth_google]] |
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
export GOOGLE_CLIENT_ID=your_google_client_id | |
export GOOGLE_CLIENT_SECRET=your_google_client_secret |
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
# App artifacts | |
... # Code removed for readability | |
.env |
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.UserTest do | |
use Catcasts.ModelCase | |
alias Catcasts.User | |
@valid_attrs %{token: "fahoifhaoaew0rheh0", email: "batman@example.com", | |
first_name: "Bruce", last_name: "Wayne", provider: "google"} | |
@invalid_attrs %{} | |
test "changeset with valide attributes" do | |
changeset = User.changeset(%User{}, @valid_attrs) |
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.AddUsers do | |
use Ecto.Migration | |
def change do | |
create table(:users) do | |
add :first_name, :string | |
add :last_name, :string | |
add :email, :string | |
add :provider, :string | |
add :token, :string |