drupal-react-oauth-provider
Version:
Drupal React Oauth Provider and Hooks for REST / JSONAPI etc.
31 lines (30 loc) • 879 B
TypeScript
import { Data, Error, Loading } from '../../returnTypes';
declare type Login = {
username: string;
password: string;
client_id: string;
client_secret: string;
grant_type: string;
scope: string;
};
interface LazyLogin {
loading: Loading;
error: Error;
data: Data;
}
declare type UseLazyLogin = [(params: Login) => void, LazyLogin];
/**
* The oauth settings get saved to localStorage so refresh tokens work. Doing it this way means you can easily have multiple oauth clients in one app.
* @example
* const [login, { loading, error, data }] = useLazyLogin();
* login({
* username: 'username',
* password: 'password',
* client_id: 'client_id',
* client_secret: 'client_secret',
* grant_type: 'grant_type',
* scope: 'scope',
* });
*/
export declare const useLazyLogin: () => UseLazyLogin;
export {};