3.1.2 • Published 4 months ago

@turkos/base-login-methods v3.1.2

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

Introduction

Visar en eller flera inloggningsmetoder som appen skickar till detta plugin.

Guider för att bygga ett library: https://itnext.io/create-a-vue-js-component-library-as-a-module-part-1-a1116e632751 https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c https://www.telerik.com/blogs/vuejs-how-to-build-your-first-package-publish-it-on-npm https://vuejs.org/v2/cookbook/packaging-sfc-for-npm.html

Getting Started

Installation:

För att bygga detta plugin som ett bibliotek för att sedan kunna installera i en annan app: 1. Kör pipeline Eller 1. npm run build 2. npm pack 3. npm publish

Installera det sedan i den app du vill med: npm install @turkos/base-login-methods Detta kräver att projektet du vill installera i har en .npmrc-fil som pekar på samma registry som i detta projekt.

Installera detta plugin i appens main.ts eller liknande startfil: import BaseLoginMethods from '@turkos/base-login-methods'; import '@turkos/base-login-methods/style.css';

/* Login Methods / app.use(BaseLoginMethods);

I önskad .vue-fil:

Exempel på en loginmetod som skickar in värden till detta plugin: function login() { let comeBackUrl = '/'; if (route.query.comeBack) { const { name, path } = router.resolve({ path: route.query.comeBack.toString(), }); // Set the comeBackUrl if it is valid if (name && path) { comeBackUrl = path; } }

	const tempLoginUrl =
		$auth.loginCitizen(comeBackUrl, ['AllLoginMethods']) ?? '';
	clientState.value = tempLoginUrl.split('&state=')[1].split('&')[0];
	clientNames.value = tempLoginUrl
		.split('&client_name=')[1]
		.split('&')[0];
	cancelUrl.value = tempLoginUrl
		.split('&frejaCancelUrl=')[1]
		.split('&')[0];
	allClientsConfig.value = $auth.getAllClientsConfig();

	doLogin.value = true;
}

Build and Test

Contribute

3.1.2

4 months ago

2.1.0

4 months ago

3.1.1

4 months ago