@digigov/auth
Advanced tools
Comparing version 0.0.1-alpha.175 to 0.0.1-alpha.176
@@ -26,3 +26,3 @@ import React from 'react'; | ||
error: null; | ||
navigate: (url: any) => void; | ||
navigate: (url: any) => never; | ||
}; | ||
@@ -29,0 +29,0 @@ export declare const AuthContext: React.Context<ContextValue>; |
@@ -32,3 +32,3 @@ "use strict"; | ||
navigate: function navigate(url) { | ||
console.warn("set a custom navigate function to handle URL ".concat(url)); | ||
throw new Error("set a custom navigate function to handle URL ".concat(url)); | ||
} | ||
@@ -35,0 +35,0 @@ }; |
@@ -23,2 +23,3 @@ "use strict"; | ||
id: action.id, | ||
authenticated: true, | ||
processing: false, | ||
@@ -50,2 +51,3 @@ error: null, | ||
id: null, | ||
authenticated: false, | ||
processing: false, | ||
@@ -62,8 +64,2 @@ code: null, | ||
case 'authenticated': | ||
return update((0, _extends2["default"])({}, state, { | ||
processing: false, | ||
error: null | ||
})); | ||
case 'error': | ||
@@ -70,0 +66,0 @@ return update((0, _extends2["default"])({}, state, { |
@@ -15,3 +15,3 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; | ||
navigate: function navigate(url) { | ||
console.warn("set a custom navigate function to handle URL ".concat(url)); | ||
throw new Error("set a custom navigate function to handle URL ".concat(url)); | ||
} | ||
@@ -18,0 +18,0 @@ }; |
@@ -11,2 +11,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
id: action.id, | ||
authenticated: true, | ||
processing: false, | ||
@@ -38,2 +39,3 @@ error: null, | ||
id: null, | ||
authenticated: false, | ||
processing: false, | ||
@@ -50,8 +52,2 @@ code: null, | ||
case 'authenticated': | ||
return update(_extends({}, state, { | ||
processing: false, | ||
error: null | ||
})); | ||
case 'error': | ||
@@ -58,0 +54,0 @@ return update(_extends({}, state, { |
@@ -17,3 +17,3 @@ import { useEffect, useMemo } from 'react'; | ||
var path = '/'; | ||
var newpath = path + '?next=' + next + '&'; | ||
var newpath = path + '?next=' + next; | ||
navigate(newpath); | ||
@@ -32,3 +32,3 @@ } | ||
useEffect(function () { | ||
if (auth.authenticated && user && !checkUserType(user)) { | ||
if (user && !checkUserType(user)) { | ||
onError && onError(); | ||
@@ -35,0 +35,0 @@ navigate('/'); |
@@ -196,3 +196,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
navigate: state.navigate, | ||
authenticated: !!state.user, | ||
authenticated: !!state.authenticated, | ||
processing: state.processing, | ||
@@ -199,0 +199,0 @@ user: state.user, |
@@ -15,3 +15,3 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; | ||
navigate: function navigate(url) { | ||
console.warn("set a custom navigate function to handle URL ".concat(url)); | ||
throw new Error("set a custom navigate function to handle URL ".concat(url)); | ||
} | ||
@@ -18,0 +18,0 @@ }; |
@@ -11,2 +11,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
id: action.id, | ||
authenticated: true, | ||
processing: false, | ||
@@ -38,2 +39,3 @@ error: null, | ||
id: null, | ||
authenticated: false, | ||
processing: false, | ||
@@ -50,8 +52,2 @@ code: null, | ||
case 'authenticated': | ||
return update(_extends({}, state, { | ||
processing: false, | ||
error: null | ||
})); | ||
case 'error': | ||
@@ -58,0 +54,0 @@ return update(_extends({}, state, { |
@@ -17,3 +17,3 @@ import { useEffect, useMemo } from 'react'; | ||
var path = '/'; | ||
var newpath = path + '?next=' + next + '&'; | ||
var newpath = path + '?next=' + next; | ||
navigate(newpath); | ||
@@ -32,3 +32,3 @@ } | ||
useEffect(function () { | ||
if (auth.authenticated && user && !checkUserType(user)) { | ||
if (user && !checkUserType(user)) { | ||
onError && onError(); | ||
@@ -35,0 +35,0 @@ navigate('/'); |
@@ -1,2 +0,2 @@ | ||
/** @license Digigov v0.0.1-alpha.175 | ||
/** @license Digigov v0.0.1-alpha.176 | ||
* | ||
@@ -201,3 +201,3 @@ * This source code is licensed under the MIT license found in the | ||
navigate: state.navigate, | ||
authenticated: !!state.user, | ||
authenticated: !!state.authenticated, | ||
processing: state.processing, | ||
@@ -204,0 +204,0 @@ user: state.user, |
@@ -33,3 +33,3 @@ "use strict"; | ||
var path = '/'; | ||
var newpath = path + '?next=' + next + '&'; | ||
var newpath = path + '?next=' + next; | ||
navigate(newpath); | ||
@@ -49,3 +49,3 @@ } | ||
(0, _react.useEffect)(function () { | ||
if (auth.authenticated && user && !checkUserType(user)) { | ||
if (user && !checkUserType(user)) { | ||
onError && onError(); | ||
@@ -52,0 +52,0 @@ navigate('/'); |
@@ -1,2 +0,2 @@ | ||
/** @license Digigov v0.0.1-alpha.175 | ||
/** @license Digigov v0.0.1-alpha.176 | ||
* | ||
@@ -255,3 +255,3 @@ * This source code is licensed under the MIT license found in the | ||
navigate: state.navigate, | ||
authenticated: !!state.user, | ||
authenticated: !!state.authenticated, | ||
processing: state.processing, | ||
@@ -258,0 +258,0 @@ user: state.user, |
{ | ||
"name": "@digigov/auth", | ||
"version": "0.0.1-alpha.175", | ||
"version": "0.0.1-alpha.176", | ||
"description": "@digigov authentication client", | ||
@@ -20,5 +20,5 @@ "author": "GRNET Developers <devs@lists.grnet.gr>", | ||
}, | ||
"gitHead": "e5a7231e951626db462e6a6bf33185e83b4f0ad5", | ||
"gitHead": "1753e59e31e239e7afe0251e815f694aa450d59c", | ||
"private": false, | ||
"typings": "./index.d.ts" | ||
} |
75283
2257