Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
NEXMO_API_KEY=''
NEXMO_API_SECRET=''
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ cp .env.example .env
Next you will need to sign up for a Nexmo account and get your API credentials from the API dashboard and put them in your `.env`
file.

Finally all that's left is to start the server.
Finally all that's left is to migrate the database and start the server.

```sh
rake db:migrate
rails server
```

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/verifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ def new
end

def create
response = client.check_verification(
session[:verification_id],
response = client.verify.check(
request_id: session[:verification_id],
code: params[:code]
)

if response['status'] == '0'
if response.status == '0'
session[:verified] = true
redirect_to :root
else
Expand All @@ -22,14 +22,14 @@ def create
private

def send_verification_request
response = client.start_verification(
response = client.verify.request(
number: current_user.number,
brand: 'MyApp'
)

if response['status'] == '0'
if response.status == '0'
session[:verification_id] =
response['request_id']
response.request_id
end
end

Expand Down