Skip to content

Commit 37b4c3d

Browse files
author
Inbal Tako
committed
Update readme
1 parent aaa85da commit 37b4c3d

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,20 @@ require 'securenative'
6262
require 'securenative/event_type'
6363

6464

65-
def reset_password
66-
# Do some cool stuff here
67-
# ...
68-
# ...
69-
70-
SecureNative.verify(Event.new(
71-
event_type = EventTypes::PASSWORD_RESET,
72-
user: User.new("1", "Jon Snow", "[email protected]"),
73-
ip: "1.2.3.4",
74-
remote_ip: "5.6.7.8",
75-
user_agent: "Mozilla/5.0 (Linux; U; Android 4.4.2; zh-cn; GT-I9500 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.0 QQ-URL-Manager Mobile Safari/537.36",
76-
sn_cookie: "cookie"))
65+
def reset_password
66+
res = SecureNative.verify(Event.new(
67+
event_type = EventTypes::PASSWORD_RESET,
68+
user: User.new("1", "Jon Snow", "[email protected]"),
69+
ip: "1.2.3.4",
70+
remote_ip: "5.6.7.8",
71+
user_agent: "Mozilla/5.0 (Linux; U; Android 4.4.2; zh-cn; GT-I9500 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.0 QQ-URL-Manager Mobile Safari/537.36",
72+
sn_cookie: "cookie"))
73+
74+
if res['riskLevel'] == 'high'
75+
return 'Cannot change password'
76+
else res['riskLevel'] == 'medium'
77+
return 'MFA'
78+
end
7779
end
7880
```
7981

0 commit comments

Comments
 (0)