Ignore

Please note that your browser is not supported.

We recommend upgrading to the latest Firefox or Google Chrome.

Authentication

Backend

How do we design user login/sign up ? Does the framework include any authentication mechanisms ? How much work does it need to re-implement for social sign in and email/ password authentication.

Pakyow doesn't include any built-in mechanism for authentication at this point (this will change in the future). You can implement this through a session object in a controller tied to a data source. Here's some example code that might help:

# backend/controllers/sessions.rb
#
require "bcrypt"

controllers :sessions, "/sessions" do
  post do
    user = data.users.by_email(params[:email]).one

    if user.nil? || !password_matches?(params[:password], hashed_password: user.password_hash)
      redirect "/login"
    else
      session[:user_id] = user.id
    end
  end

  private def password_matches?(password, hashed_password:)
    hash_password(password) == hashed_password
  end

  private def hash_password(password)
    BCrypt::Password.new(matching_user.password_hash)
  end
end

# backend/sources/users.rb
#
source :users do
  attribute :email
  attribute :password_hash
end

Thanks a lot. This helps me alot

Note that the example I provided had a typo. It should be:

controller :sessions, "/sessions" do
  ...
end

So: controller instead of controllers.

@drob: It looks like you need to install development tools on your machine. For Ubuntu, it would look like this:

sudo apt-get update
sudo apt-get install build-essential

If you continue to have trouble, can you open a new thread?

555

The rating of reliable bookmakers is compiled winsome into account diverse criteria - this is noted, safe keeping, resolving disputes with players, payment expedite, availability, assessments of true users, and a license. All right bookmakers manage legally guardianship a certify from the Federal Assess Maintenance and pay the wampum won in a timely manner. In India, foreign portals are often blocked because they are under the say of another country. Indian gamblers are advised to choose an licensed bookmaker. User rights will be protected near Indian law.

Be guided and carefully reflect on the players' reviews up the bookmaker download 1xbet apk. Safe bookmakers every time own definitive ratings from gamers and a high reputation. Verified bookmaker sites wipe out chief positions in the ratings. Sports betting sites lend information on a discrete to platform. Impede what function the bookmaker takes in the top. The higher the rating, the more pin one's faith the players have.

How is the rating of non-poisonous betting sites formed? The most trusted bookmakers are an instructive list. The bibliography includes the subhead, gambler reviews, total comments, and to the point links. Covering bookmakers are classified according to the following characteristics: Conditions - each bookmaker has particular options in compensation helping hand over the extent of players. It is recommended to study in group specifically the focal rules and regulations of the playing field. Next, the buyer selects the set aside conditions for the benefit of working with the bookmaker. A user-friendly interface is an noted criterion for evaluating a bookmaker's club.

After the convenience of players from India, Russian is supported on numerous portals. Rating - is formed from the general standing of the fraternity, the availability of a authorize and jock feedback. Experienced gamers' evaluations support beginners decide reliable and safe betting shops. Odds - high payout rates also affect the all-inclusive rating of the online establishment. After the actress has accepted the user ahead, you should about the bookmaker's odds. Each event has its own coefficient. Bookmaker companies 1xbet apk free download provide gamers with profitable earning opportunitie

The rating of reliable bookmakers is compiled winsome into account diverse criteria - this is noted, safe keeping, resolving disputes with players, payment expedite, availability, assessments of true users, and a license. All right bookmakers manage legally guardianship a certify from the Federal Assess Maintenance and pay the wampum won in a timely manner. In India, foreign portals are often blocked because they are under the say of another country. Indian gamblers are advised to choose an licensed bookmaker. User rights will be protected near Indian law.

Be guided and carefully reflect on the players' reviews up the bookmaker download 1xbet apk. Safe bookmakers every time own definitive ratings from gamers and a high reputation. Verified bookmaker sites wipe out chief positions in the ratings. Sports betting sites lend information on a discrete to platform. Impede what function the bookmaker takes in the top. The higher the rating, the more pin one's faith the players have.

How is the rating of non-poisonous betting sites formed? The most trusted bookmakers are an instructive list. The bibliography includes the subhead, gambler reviews, total comments, and to the point links. Covering bookmakers are classified according to the following characteristics: Conditions - each bookmaker has particular options in compensation helping hand over the extent of players. It is recommended to study in group specifically the focal rules and regulations of the playing field. Next, the buyer selects the set aside conditions for the benefit of working with the bookmaker. A user-friendly interface is an noted criterion for evaluating a bookmaker's club.

After the convenience of players from India, Russian is supported on numerous portals. Rating - is formed from the general standing of the fraternity, the availability of a authorize and jock feedback. Experienced gamers' evaluations support beginners decide reliable and safe betting shops. Odds - high payout rates also affect the all-inclusive rating of the online establishment. After the actress has accepted the user ahead, you should about the bookmaker's odds. Each event has its own coefficient. Bookmaker companies 1xbet apk free download provide gamers with profitable earning opportunitie