Software /
code /
prosody-modules
Comparison
mod_http_oauth2/mod_http_oauth2.lua @ 5195:b4932915e773
mod_http_oauth2: Mention name of client when giving out OOB authorization code
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 03 Mar 2023 21:45:24 +0100 |
parent | 5194:25041e15994e |
child | 5196:6b63af56c8ac |
comparison
equal
deleted
inserted
replaced
5194:25041e15994e | 5195:b4932915e773 |
---|---|
144 -- mod_http_errors will set content-type to text/plain if it catches this event | 144 -- mod_http_errors will set content-type to text/plain if it catches this event |
145 local response = { status_code = 200; headers = { content_type = "text/plain" } } | 145 local response = { status_code = 200; headers = { content_type = "text/plain" } } |
146 response.body = module:context("*"):fire_event("http-message", { | 146 response.body = module:context("*"):fire_event("http-message", { |
147 response = response; | 147 response = response; |
148 title = "Your authorization code"; | 148 title = "Your authorization code"; |
149 message = "Here's your authorization code, copy and paste it into your app:"; | 149 message = "Here's your authorization code, copy and paste it into " .. (client.client_name or "your client"); |
150 extra = code; | 150 extra = code; |
151 }) or ("Here's your authorization code:\n%s\n"):format(code); | 151 }) or ("Here's your authorization code:\n%s\n"):format(code); |
152 return response; | 152 return response; |
153 end | 153 end |
154 | 154 |