Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@applers/auth-magic-link-nest

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applers/auth-magic-link-nest - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

4

dist/src/auth-magic-link.module.js

@@ -82,3 +82,3 @@ "use strict";

(0, common_1.Post)(paths.magicLink.request)(login_controller_1.LoginController, login_controller_1.LoginController.prototype.requestMagicLink.name, Object.getOwnPropertyDescriptor(login_controller_1.LoginController.prototype, login_controller_1.LoginController.prototype.requestMagicLink.name));
(0, common_1.Get)(paths.magicLink.validate.success)(login_controller_1.LoginController, login_controller_1.LoginController.prototype.validate.name, Object.getOwnPropertyDescriptor(login_controller_1.LoginController.prototype, login_controller_1.LoginController.prototype.validate.name));
(0, common_1.Get)(paths.magicLink.validate)(login_controller_1.LoginController, login_controller_1.LoginController.prototype.validate.name, Object.getOwnPropertyDescriptor(login_controller_1.LoginController.prototype, login_controller_1.LoginController.prototype.validate.name));
(0, common_1.Post)(paths.magicLink.logout)(login_controller_1.LoginController, login_controller_1.LoginController.prototype.logout.name, Object.getOwnPropertyDescriptor(login_controller_1.LoginController.prototype, login_controller_1.LoginController.prototype.logout.name));

@@ -91,3 +91,3 @@ // should be ok to apply it on all routes

.apply(authentication_middleware_1.AuthenticationMiddleware)
.exclude(paths.magicLink.request, paths.magicLink.validate.success, ...(paths.auth?.exclude ?? []))
.exclude(paths.magicLink.request, paths.magicLink.validate, ...(paths.auth?.exclude ?? []))
.forRoutes('*');

@@ -94,0 +94,0 @@ }

@@ -33,6 +33,6 @@ "use strict";

const status = exception.getStatus();
const redirectPath = this.config.paths.magicLink.validate.failure;
if (redirectPath) {
this.cookieTokenService.removeCookies(response);
response.status(status).redirect(redirectPath);
this.cookieTokenService.removeCookies(response);
const failureRedirectPath = this.config.frontendUrls.auth.redirect.failure;
if (failureRedirectPath) {
response.status(status).redirect(failureRedirectPath);
}

@@ -39,0 +39,0 @@ else {

@@ -15,6 +15,3 @@ import { RouteInfo } from '@nestjs/common/interfaces';

request: string;
validate: {
success: string;
failure?: string;
};
validate: string;
logout: string;

@@ -26,6 +23,14 @@ };

}
export interface AuthMagicLinkFrontendUrlsConfig {
auth: {
redirect: {
success: string;
failure?: string;
};
};
}
export declare const ExcludedRouteMethod: typeof RequestMethod;
export interface AuthMagicLinkConfig {
frontendUrls: AuthMagicLinkFrontendUrlsConfig;
paths: AuthMagicLinkPathsConfig;
redirectUrl: string;
httpsOnly: boolean;

@@ -32,0 +37,0 @@ magicLinkToken: TokenConfig;

@@ -35,6 +35,6 @@ "use strict";

async validate(response, email) {
const { redirectUrl } = this.config;
const { frontendUrls } = this.config;
const { userId } = await this.util.findOrCreateByEmail({ email });
await this.cookieTokenService.prepareResponseWithNewTokens(response, userId);
response.redirect(redirectUrl);
response.redirect(frontendUrls.auth.redirect.success);
return;

@@ -41,0 +41,0 @@ }

@@ -39,3 +39,3 @@ "use strict";

this.config.paths.proxy ?? '',
this.config.paths.magicLink.validate.success,
this.config.paths.magicLink.validate,
])

@@ -42,0 +42,0 @@ .query({ token })

import { DeepRequired, Merge } from 'ts-essentials';
import { AuthMagicLinkConfig, AuthMagicLinkPathsConfig } from './environment.types';
export type FullAuthMagicLinkConfig = Merge<DeepRequired<Omit<AuthMagicLinkConfig, 'paths'>>, {
import { AuthMagicLinkConfig, AuthMagicLinkFrontendUrlsConfig, AuthMagicLinkPathsConfig } from './environment.types';
export type FullAuthMagicLinkConfig = Merge<DeepRequired<Omit<AuthMagicLinkConfig, 'paths' | 'frontendUrls'>>, {
paths: AuthMagicLinkPathsConfig;
frontendUrls: AuthMagicLinkFrontendUrlsConfig;
}>;
//# sourceMappingURL=types.d.ts.map
{
"name": "@applers/auth-magic-link-nest",
"version": "4.0.0",
"version": "5.0.0",
"description": "",

@@ -5,0 +5,0 @@ "author": "Can Pekesen <cpekesen@applers.de>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc