@adonisjs/auth
Advanced tools
Comparing version 3.0.4 to 3.0.5
@@ -0,1 +1,11 @@ | ||
<a name="3.0.5"></a> | ||
## [3.0.5](https://github.com/adonisjs/adonis-auth/compare/v3.0.4...v3.0.5) (2018-03-30) | ||
### Features | ||
* **apischeme:** allow clientLogin to accept user instance ([97ba27d](https://github.com/adonisjs/adonis-auth/commit/97ba27d)) | ||
<a name="3.0.4"></a> | ||
@@ -2,0 +12,0 @@ ## [3.0.4](https://github.com/adonisjs/adonis-auth/compare/v3.0.3...v3.0.4) (2018-03-18) |
{ | ||
"name": "@adonisjs/auth", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "Offical authentication provider for Adonis framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -193,10 +193,14 @@ 'use strict' | ||
* | ||
* @param {Function} headerFn - Method to set the header | ||
* @param {Function} sessionFn - Method to set the session | ||
* @param {Object} user - User to login | ||
* @param {Function} headerFn - Method to set the header | ||
* @param {Function} sessionFn - Method to set the session | ||
* @param {Object} tokenOrUser - Pass the token or the user directly | ||
* | ||
* @return {void} | ||
*/ | ||
async clientLogin (headerFn, sessionFn, token) { | ||
headerFn('authorization', `Bearer ${token}`) | ||
async clientLogin (headerFn, sessionFn, tokenOrUser) { | ||
if (typeof (tokenOrUser) !== 'string') { | ||
const { token } = await this.generate(tokenOrUser) | ||
tokenOrUser = token | ||
} | ||
headerFn('authorization', `Bearer ${tokenOrUser}`) | ||
} | ||
@@ -203,0 +207,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109518
3211