liquid_feedback_frontend
view env/util/get_access_token.lua @ 1535:770ab0a7f79b
Added optional callback after creation of new draft
| author | bsw | 
|---|---|
| date | Tue Oct 06 19:31:19 2020 +0200 (2020-10-06) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 function util.get_access_token()
     3   local access_token_header = request.get_header("Authorization")
     4   if access_token_header then
     5     access_token_header = string.match(access_token_header, "^Bearer ([^ ,]*)$")
     6   end
     8   local access_token_param = param.get("access_token")
    10   if access_token_header and access_token_param then
    11     return nil, "header_and_param"
    12   end
    14   return(access_token_header or access_token_param)
    16 end
