Advertisement
Guest User

Untitled

a guest
May 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function provider.test_password(username, password)
  2. username = nodeprep(username);
  3. if not username then
  4. return nil, "jid-malformed";
  5. end
  6. body, code, headers = http.request {
  7. url = auth_url...'?username='..url.encode(username)..'&password='..url.encode(password);
  8. }
  9. if code == 200 then
  10. return true;
  11. else
  12. return nil, "policy-violation";
  13. end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement