Software /
code /
prosody-modules
Comparison
mod_adhoc_oauth2_client/mod_adhoc_oauth2_client.lua @ 4266:b43c6d614d22
mod_adhoc_oauth2_client: Fix adhoc status on error
There's no 'error' status, it's 'canceled' and an error message.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 22 Nov 2020 16:17:24 +0100 |
parent | 4263:d3af5f94d6df |
child | 4267:43284437c5ed |
comparison
equal
deleted
inserted
replaced
4265:7b4a73364363 | 4266:b43c6d614d22 |
---|---|
45 client.iteration_count = i; | 45 client.iteration_count = i; |
46 client.salt = salt; | 46 client.salt = salt; |
47 | 47 |
48 local ok, err = errors.coerce(clients:set(creator, client_id, client)); | 48 local ok, err = errors.coerce(clients:set(creator, client_id, client)); |
49 module:log("info", "OAuth2 client %q created by %s", client_id, data.from); | 49 module:log("info", "OAuth2 client %q created by %s", client_id, data.from); |
50 if not ok then return {status = "error"; error = {message = err}}; end | 50 if not ok then return {status = "canceled"; error = {message = err}}; end |
51 | 51 |
52 return {status = "completed"; result = {layout = client_created; values = {client_id = client.client_id; client_secret = client_secret}}}; | 52 return {status = "completed"; result = {layout = client_created; values = {client_id = client.client_id; client_secret = client_secret}}}; |
53 end | 53 end |
54 | 54 |
55 local handler = adhoc.new_simple_form(new_client, create_client); | 55 local handler = adhoc.new_simple_form(new_client, create_client); |