Releases: portier/portier-node
Releases · portier/portier-node
v0.7.0
-
BREAKING: This PR reverts the API change made to the
verify
method in v0.6.0:-async verify(token: string): Promise<{ email: string; state?: string }> { +async verify(token: string): Promise<string> {
v0.6.0 mistakenly assumed
state
was part of the token, but it is simply returned in a query parameterstate
to the callback / redirect URI. As such, your application can extract it directly from the request.
v0.6.0
-
The
authenticate
method now takes an optional second argumentstate
, which is returned byverify
in your callback:-async authenticate(email: string): Promise<string> +async authenticate(email: string, state?: string): Promise<string>
-
BREAKING: The
verify
method now returns (a promise for) an object, so that it can also return the originalstate
from the call toauthenticate
:-async verify(token: string): Promise<string> { +async verify(token: string): Promise<{ email: string; state?: string }> {
v0.5.0
- The minimum Node.js version has been bumped to v18.
- This package now uses ESM. The
PortierClient
class is the default export.-const { PortierClient } = require("portier"); +import PortierClient from "portier";
RedisStore
has been upgrade to the npmredis
v4 package (ie.@redis/client
v1).- The
node-fetch
dependency has been dropped and replaced by the Node.js built-infetch
API.