Useful frappe features for your random purposes
$ bench get-app https://github.com/leam-tech/frappe_util_configs
You dont have to install this app in any frappe site. Please follow the sections below to make use of those features
JSON WebToken are easy to work with compared to Session Cookies. We present you JWT Support in frappe.
-
To start using this, please run the following:
$ bench frappe-util-configs initThis command will update the
config/supervisor.confto usefrappe_util_configs.app:applicationas gunicorn entry point and replaces defaultfrappe/socket.iowithfrappe_util_configs/socket.io -
To obtain a token, pass
use_jwt: 1along with email and passwordPOST /api/method/login { "usr": "administrator", "pwd": "my-pwd", "use_jwt": 1 }You will get the token in the response
-
To use the token, pass it in
AuthorizationheaderPOST /api/method/frappe.auth.get_logged_user Authorization: JWT <token>
Cross Origin Resource Sharing might be required when you have custom applications running To have the CORS headers available in production mode, run
$ bench frappe-util-configs nginx
MIT