Example using the Credential Management API to save user credentials and retrieve it when reloading. Then use them to authenticate the user agains a server, the server reply with a JWT and is saved in a cookie for further usage when reloading.
This example only uses this WebAPI in Chrome (not iOS Chrome), any browser that doesn't support this WebAPI reload the page to authenticate the user.
Example running: https://next-credentials.now.sh/