diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-14 18:19:14 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-14 18:19:14 +0800 |
commit | 306cf74eb0101a12b51549866a4d60296618ee0b (patch) | |
tree | 89fe13b234f40f97de84cdb6610bcd11e1d47a88 /config.h |
OAuth part
The minimum to pass all authentications and arrive at the embedded app
index. This library is to be used with shopify-app-template-c for now,
as it assumes the existence of shopify.app.toml in the parent directory,
and index.html in the frontend directory.
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/config.h b/config.h new file mode 100644 index 0000000..939d86b --- /dev/null +++ b/config.h @@ -0,0 +1,10 @@ +#include <toml.h> + +static inline void config_getscopes(const char *scope_path, char **scopes) +{ + FILE *fp = fopen(scope_path, "r"); + toml_table_t* toml = toml_parse_file(fp, NULL, 0); + fclose(fp); + *scopes = toml_string_in(toml, "scopes").u.s; + toml_free(toml); +} |