Skip to content

Commit e747e2f

Browse files
committed
Adding auth_check for the application
This lets us determine if we've got our preferences set up right. Awesome.
1 parent 2f40052 commit e747e2f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

controllers/sessions_controller.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,14 @@
6262
redirect '/'
6363
end
6464

65+
# This method allows people to check their credentials. This is primarily used
66+
# by the desktop app to see if you've entered correct information.
67+
post '/check_credentials' do
68+
#let's see if we got a correct username/password:
69+
puts "username: #{params[:username]} / #{params[:password]}"
70+
if Hacker.authenticate(params[:username], params[:password])
71+
"Success"
72+
else
73+
halt 401
74+
end
75+
end

0 commit comments

Comments
 (0)