Signup page

This commit is contained in:
bumi 2020-04-28 11:08:12 +02:00
parent 6da553102d
commit b9f63c5f8c
4 changed files with 38 additions and 4 deletions

View File

@ -1,6 +1,10 @@
# frozen_string_literal: true
class SessionsController < ApplicationController
def create
reset_session
end
def new
reset_session
end

View File

@ -5,17 +5,16 @@
<div class="container has-text-centered">
<div class="box">
<h3 class="title has-text-centered">
Login
Welcome back!
</h3>
<hr>
<%= link_to auth_at_provider_url(provider: 'google'), class: 'button google' do %>
<%= link_to auth_at_provider_url(provider: 'google'), class: 'button is-medium google' do %>
<svg viewBox="0 0 15 15" class="googleLogo" style="width: 14px; height: 14px; display: block; fill: currentcolor; flex-shrink: 0; backface-visibility: hidden; margin-right: 6px;"><path d="M 7.28571 6.4125L 7.28571 9L 11.3929 9C 11.2143 10.0875 10.1429 12.225 7.28571 12.225C 4.78571 12.225 2.78571 10.0875 2.78571 7.5C 2.78571 4.9125 4.82143 2.775 7.28571 2.775C 8.71429 2.775 9.64286 3.4125 10.1786 3.9375L 12.1429 1.9875C 10.8929 0.75 9.25 0 7.28571 0C 3.25 0 0 3.3375 0 7.5C 0 11.6625 3.25 15 7.28571 15C 11.5 15 14.25 11.9625 14.25 7.6875C 14.25 7.2 14.2143 6.825 14.1429 6.45L 7.28571 6.45L 7.28571 6.4125Z"></path></svg>
Login with Google
<% end %>
<hr>
<p>
Login with your existing Google account, no new credentials needed.
<br>
Do you need help? <%= link_to 'let us know', help_url %>.
</p>
</div>

View File

@ -0,0 +1,31 @@
<div class="columns">
<div class="column">
</div>
<div class="column">
<div class="container has-text-centered">
<div class="box">
<h3 class="title has-text-centered">
Welcome to tinyforms!
</h3>
<hr>
<p>
Use your existing Google account to get started.
<br>
No additional information required.
</p>
<p style="margin-top:1em">
<%= link_to auth_at_provider_url(provider: 'google'), class: 'button is-medium google' do %>
<svg viewBox="0 0 15 15" class="googleLogo" style="width: 14px; height: 14px; display: block; fill: currentcolor; flex-shrink: 0; backface-visibility: hidden; margin-right: 6px;"><path d="M 7.28571 6.4125L 7.28571 9L 11.3929 9C 11.2143 10.0875 10.1429 12.225 7.28571 12.225C 4.78571 12.225 2.78571 10.0875 2.78571 7.5C 2.78571 4.9125 4.82143 2.775 7.28571 2.775C 8.71429 2.775 9.64286 3.4125 10.1786 3.9375L 12.1429 1.9875C 10.8929 0.75 9.25 0 7.28571 0C 3.25 0 0 3.3375 0 7.5C 0 11.6625 3.25 15 7.28571 15C 11.5 15 14.25 11.9625 14.25 7.6875C 14.25 7.2 14.2143 6.825 14.1429 6.45L 7.28571 6.45L 7.28571 6.4125Z"></path></svg>
Login with Google
<% end %>
</p>
<hr>
<p>
Do you need help? <%= link_to 'let us know', help_url %>.
</p>
</div>
</div>
</div>
<div class="column">
</div>
</div>

View File

@ -23,7 +23,7 @@ Rails.application.routes.draw do
get 'oauth/callback', to: 'oauths#callback'
get 'oauth/:provider', to: 'oauths#oauth', as: :auth_at_provider
get '/signup' => 'sessions#new', :as => :signup # TODO: add proper signup page
get '/signup' => 'sessions#signup', :as => :signup
get '/login' => 'sessions#new', :as => :login
get '/logout' => 'sessions#destroy', :as => :logout
get '/auth' => 'sessions#auth', :as => :auth