KEYCLOAK-14652 Align custom adapter example with documentation

This commit is contained in:
Jon Koops 2020-07-02 10:12:56 +02:00 committed by Bruno Oliveira da Silva
parent 78a1c6cf23
commit 098446b070

View file

@ -74,14 +74,19 @@ declare namespace Keycloak {
* ```ts * ```ts
* import Keycloak, { KeycloakAdapter } from 'keycloak-js'; * import Keycloak, { KeycloakAdapter } from 'keycloak-js';
* *
* class MyCustomAdapter implements KeycloakAdapter { * // Implement the 'KeycloakAdapter' interface so that all required methods are guaranteed to be present.
* // Implement methods required by KeycloakAdapter here. * const MyCustomAdapter: KeycloakAdapter = {
* } * login(options) {
* // Write your own implementation here.
* }
*
* // The other methods go here...
* };
* *
* const keycloak = new Keycloak(); * const keycloak = new Keycloak();
* *
* keycloak.init({ * keycloak.init({
* adapter: MyCustomAdapter, * adapter: MyCustomAdapter,
* }); * });
* ``` * ```
*/ */