Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enable :sessions
- get '/' do
- erb :login
- end
- post '/' do
- email = params[:email]
- password = params[:password]
- found_user = User.first(:email=>email, :password=>password)
- if found_user != nil
- session['authenticated'] = true
- redirect '/todays_budget'
- else
- status 401
- end
- end
- get '/todays_budget' do
- if not session['authenticated']
- status 401
- "Login Failure"
- else
- erb :current_cash_flow_view
- end
- end
Add Comment
Please, Sign In to add comment