Wappi-fe provides built-in authentication handling to seamlessly manage user sessions and secure API calls.
To generate authentication with wappi, you need to add code to your wappi server endpoint called Core_Login_1_0_0 or any subsequent versions.
When this endpoint is called, wappi-fe will set a auth token to localStorage of the browser / device called: wappiAuthToken.
This Auth Token will be used as an encrypted authentication between your frontend and backend.
If the token is expired, or incorrect. Then endpoint will return:
1success: falseWhen calling request. You only need to pass in the flag
boolean
optionally required - depends on query type
If true, it will get the auth token that is automatically set.
See the Authentication section.
1const response = async () => (request(WAPPI_CONFIG, {
2 name: 'Request',
3 query: 'NameSpace_FunctionName_1_0_0',
4 data: {
5 // ... body object specific to the query endpoint type
6 },
7 authRequired: true,
8}))If an endpoint doesn't require auth, then don't include it.
1const response = async () => (request(WAPPI_CONFIG, {
2 name: 'Request',
3 query: 'NameSpace_FunctionName_1_0_0',
4 data: {
5 // ... body object specific to the query endpoint type
6 },
7}))