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

@nuxtjs/auth

Package Overview
Dependencies
Maintainers
5
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/auth - npm Package Compare versions

Comparing version 4.5.1 to 4.5.2

14

CHANGELOG.md

@@ -5,2 +5,16 @@ # Change Log

<a name="4.5.2"></a>
## [4.5.2](https://github.com/nuxt-community/auth-module/compare/v4.5.1...v4.5.2) (2018-09-18)
### Bug Fixes
* **api/auth.md:** typo([#204](https://github.com/nuxt-community/auth-module/issues/204)) ([f0e693a](https://github.com/nuxt-community/auth-module/commit/f0e693a))
* **docs:** minor proper english revisions ([#200](https://github.com/nuxt-community/auth-module/issues/200)) ([619184b](https://github.com/nuxt-community/auth-module/commit/619184b))
* **docs:** typo [#224](https://github.com/nuxt-community/auth-module/issues/224) ([752f4ad](https://github.com/nuxt-community/auth-module/commit/752f4ad))
* **docs:** update glassory read more title ([a53c38c](https://github.com/nuxt-community/auth-module/commit/a53c38c))
* **middleware:** remove trailing slash from redirect paths ([#235](https://github.com/nuxt-community/auth-module/issues/235)) ([c401122](https://github.com/nuxt-community/auth-module/commit/c401122))
<a name="4.5.1"></a>

@@ -7,0 +21,0 @@ ## [4.5.1](https://github.com/nuxt-community/auth-module/compare/v4.5.0...v4.5.1) (2018-05-21)

6

lib/core/middleware.js
import Middleware from '../middleware'
import { routeOption, getMatchedComponents } from './utilities'
import { routeOption, getMatchedComponents, normalizePath } from './utilities'

@@ -22,3 +22,3 @@ Middleware.auth = function (ctx) {

// Redirect to home page if inside login page (or login page disabled)
if (!login || ctx.route.path === login.split('?')[0]) {
if (!login || normalizePath(ctx.route.path) === normalizePath(login)) {
ctx.app.$auth.redirect('home')

@@ -31,3 +31,3 @@ }

// with `auth: false` to avoid an unnecessary redirect from callback to login)
if (!callback || ctx.route.path !== callback.split('?')[0]) {
if (!callback || normalizePath(ctx.route.path) !== normalizePath(callback)) {
ctx.app.$auth.redirect('login')

@@ -34,0 +34,0 @@ }

@@ -56,1 +56,13 @@ export const isUnset = o => typeof o === 'undefined' || o === null

}
export function normalizePath (path = '') {
// Remove query string
let result = path.split('?')[0]
// Remove redundant / from the end of path
if (result.charAt(result.length - 1) === '/') {
result = result.slice(0, -1)
}
return result
}
{
"name": "@nuxtjs/auth",
"version": "4.5.1",
"version": "4.5.2",
"description": "Authentication module for Nuxt.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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