1.4.3 • Published 11 months ago

apitwist-sso-react-native-client v1.4.3

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

apitwist-sso-react-native-client

Installation

 npm i apitwist-sso-react-native-client

Usage

Run useSSOAuth() hook in your code

import useSSOAuth from "apitwist-sso-react-native-client"

const LoginScreen = () => {
	const discovery = {
		authorizationEndpoint: 'https://sso.buinbu.com/oauth/authorize',
		tokenEndpoint: 'https://sso.buinbu.com/oauth/token',
	};
	const [login] = useSSOAuth({options: {
		clientId: "clientid",
		clientSecret: "clientsecret"
	}, discovery: discovery});
}

export default LoginScreen;

Run login function on event

<Button
	onPress={() => {
		const password_token = login()
	}}
/>

Using getUserInfo

const [login, getUserInfo] = useSSOAuth({options: {
	clientId: "clientid",
	clientSecret: "clientsecret"
}, discovery: discovery});

const data = getUserInfo()

If you want to use methods in other screens, except login()

const getUserInfo = useSSOAuth({password_token: "xxxxxxxxxx"});

const data = getUserInfo()

1.4.3

11 months ago

1.4.2

12 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.0

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago