master
E. Almqvist 3 years ago
parent 8bd577f663
commit d363aa9e77
  1. 22
      src/db_models.rb
  2. 1
      src/misc/subtitles.txt
  3. 7
      src/views/layout.slim
  4. 19
      src/views/stylesheets/style.sass
  5. 4
      src/views/user/login.slim

@ -31,27 +31,17 @@ class User < Table
check_pass_len = password.length >= MIN_PASSWORD_LEN check_pass_len = password.length >= MIN_PASSWORD_LEN
# This code is really ugly # This code is really ugly
# TODO: refactor return false, REGISTER_ERRORS[:fields] unless check_all_fields
if not check_all_fields then return false, REGISTER_ERRORS[:email_dupe] unless check_email_dupe
return false, REGISTER_ERRORS[:fields] return false, REGISTER_ERRORS[:email_fake] unless check_email_valid
elsif not check_email_dupe then return false, REGISTER_ERRORS[:name_len] unless check_name_len
return false, REGISTER_ERRORS[:email_dupe] return false, REGISTER_ERRORS[:pass_notequals] unless check_pass_equals
elsif not check_email_valid then return false, REGISTER_ERRORS[:pass_len] unless check_pass_len
return false, REGISTER_ERRORS[:email_fake]
elsif not check_name_len then
return false, REGISTER_ERRORS[:name_len]
elsif not check_pass_equals then
return false, REGISTER_ERRORS[:pass_notequals]
elsif not check_pass_len then
return false, REGISTER_ERRORS[:pass_len]
else
return true, "" return true, ""
end end
end
# Register a new user # Register a new user
# Returns: success?, data # Returns: success?, data
# TODO: input checks & ERRORS!
def register(email, name, password, password_confirm) def register(email, name, password, password_confirm)
check, errorstr = self.validate_credentials(email, name, password, password_confirm) check, errorstr = self.validate_credentials(email, name, password, password_confirm)

@ -1,7 +1,6 @@
V2FpdCwgbW9uZXkgaGFzIG5vIHZhbHVlPyEK V2FpdCwgbW9uZXkgaGFzIG5vIHZhbHVlPyEK
No such place like 127.0.0.1! No such place like 127.0.0.1!
Fourty-two? What do you mean? Tell me! Fourty-two? What do you mean? Tell me!
What sort of executable format do you intend to support for apps running under your OS?
I would just like to interject for a moment... I would just like to interject for a moment...
68747470733a2f2f777963682e6465762f6369706865722e747874 68747470733a2f2f777963682e6465762f6369706865722e747874
CSRF? No, I do not think so. CSRF? No, I do not think so.

@ -12,10 +12,17 @@ html lang="en"
h2 = get_random_subtitle h2 = get_random_subtitle
nav nav
ul ul
- unless session[:auth_token]
li li
a.button#register href="/register" target="_self" a.button#register href="/register" target="_self"
| Register | Register
li li
a.button#login href="/login" target="_self" a.button#login href="/login" target="_self"
| Log in | Log in
- else
li
a.button#profile href="/profile" target="_self"
| Profile
.content-container
==yield ==yield

@ -22,14 +22,22 @@ $special_btn_clr: #4776C1
html html
background-color: $bg_clr background-color: $bg_clr
.content-container
display: flex
flex-direction: column
justify-content: center
width: auto
height: 90%
body body
margin: 0 margin: 0
height: 100%
header header
background-color: $bg_alt_clr background-color: $bg_clr
border-bottom: 1px solid $shadow_clr // border-bottom: 1px solid $shadow_clr
padding: .1rem .8rem .4rem .8rem padding: .1rem .8rem .4rem .8rem
margin-bottom: 1rem white-space: nowrap
div div
display: flex display: flex
@ -52,7 +60,7 @@ body
h2 h2
padding-left: 6px padding-left: 6px
margin: 0 margin: 0
opacity: .5 opacity: .2
font-size: .8rem font-size: .8rem
font-style: italic font-style: italic
font-weight: normal font-weight: normal
@ -101,10 +109,11 @@ label.error_msg
form form
display: flex display: flex
flex-direction: column flex-direction: column
justify-content: center
padding: 2rem padding: 2rem
margin: 0 margin: 0
width: 60% width: 60%
max-width: 600px max-width: 400px
border-radius: .4rem border-radius: .4rem
a a

@ -1,10 +1,10 @@
.form-container .form-container
form action="/user/login" method="post" form action="/user/login" method="post"
h2 Log in h2 Log in
label.error_msg = info label.error_msg = info[:error_msg]
input type="text" name="email" placeholder="Email" input type="text" name="email" placeholder="Email"
input type="password" name="password" placeholder="Password" input type="password" name="password" placeholder="Password"
input type="submit" value="Log in" input type="submit" value="Log in"
a.button href="/register" target="_self" a.button href="/register" target="_self"
| Don't have an account? | Don't have an account? Create one!

Loading…
Cancel
Save