React - Creating a Custom Login Page

Hi,

I’m looking at creating a custom login page - I’m able to do the sign in a see the transaction data, however when I look into developer tools I see nothing being saved in the localstorage / cookies.

Is there anything else I need to do:

function myLoginButtonPress(e) {
authClient.signIn({
			username: 'test@***.com',
			password: '*****'
		})
			.then(function(transaction: any) {
				if (transaction.status === 'SUCCESS') {
					console.log(transaction); 
				authClient.session.setCookieAndRedirect(transaction.sessionToken, 'http://localhost:3000/');
				} else {
					throw 'We cannot handle the ' + transaction.status + ' status';
				}
			})
			.fail(function(err: any) {
				console.error(err);
			});

For anyone interested this is what I did:

function login(e: React.FormEvent) {
			e.preventDefault();

			const authClient = new OktaAuth({issuer: baseUrl});

			authClient
				.signIn({
					username: "xxx",
					password: "xxx",
				})
				.then(function(transaction: any) {
					if (transaction.status === "SUCCESS") {
						// This redirect method allows us to bypass Okta's default login page
						auth.redirect({sessionToken: transaction.sessionToken});
					} else {
						throw "We cannot handle the " + transaction.status + " status";
					}
				})
				.fail(function(err: any) {
					console.error(err);
				});
		}