Official Javascript repository for Clerk authentication
MIT License
Published by clerk-cookie 11 months ago
b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
Introduce Protect for authorization. (#2309) by @panteliselef
Changes in public APIs:
experimental
tags and prefixessome
from the has
utility and Protect. Protect now accepts a condition
prop where a function is expected with the has
being exposed as the param.<SignedIn>
, if no authorization props are passed.has
will throw an error if neither permission
or role
is passed.auth().protect()
for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
not-found
component set by the developerb4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
Introduce Protect for authorization. (#2309) by @panteliselef
Changes in public APIs:
experimental
tags and prefixessome
from the has
utility and Protect. Protect now accepts a condition
prop where a function is expected with the has
being exposed as the param.<SignedIn>
, if no authorization props are passed.has
will throw an error if neither permission
or role
is passed.auth().protect()
for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
not-found
component set by the developerAccept redirectUrl
as an option for auth().protect()
. (#2333) by @panteliselef
For example:
// Authorization
auth().protect({ role: 'org:admin' }, { redirectUrl: '/any-page' });
auth().protect({ permission: 'org:settings:manage' }, { redirectUrl: '/any-page' });
// Authentication
auth().protect({ redirectUrl: '/any-page' });
Updated dependencies [b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
Introduce Protect for authorization. (#2309) by @panteliselef
Changes in public APIs:
experimental
tags and prefixessome
from the has
utility and Protect. Protect now accepts a condition
prop where a function is expected with the has
being exposed as the param.<SignedIn>
, if no authorization props are passed.has
will throw an error if neither permission
or role
is passed.auth().protect()
for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
not-found
component set by the developerUpdate @zxcvbn-ts/core
from 2.2.1
to 3.0.4
. Update @zxcvbn-ts/language-common
from 3.0.2
to 3.0.4
. (#2332) by @clerk-cookie
Updated dependencies [b4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
Introduce Protect for authorization. (#2309) by @panteliselef
Changes in public APIs:
experimental
tags and prefixessome
from the has
utility and Protect. Protect now accepts a condition
prop where a function is expected with the has
being exposed as the param.<SignedIn>
, if no authorization props are passed.has
will throw an error if neither permission
or role
is passed.auth().protect()
for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
not-found
component set by the developerb4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
Introduce Protect for authorization. (#2309) by @panteliselef
Changes in public APIs:
experimental
tags and prefixessome
from the has
utility and Protect. Protect now accepts a condition
prop where a function is expected with the has
being exposed as the param.<SignedIn>
, if no authorization props are passed.has
will throw an error if neither permission
or role
is passed.auth().protect()
for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated.
not-found
component set by the developerb4868ab8f
, 2dc93d4d8
]:
Published by clerk-cookie 11 months ago
Use dynamic imports in <ClerkProvider />
which you import from @clerk/nextjs
. (#2292) by @LekoArts
Users on Next.js 12 and older can run into errors like these:
error - ./node_modules/@clerk/nextjs/dist/esm/app-router/client/ClerkProvider.js:10:22
Module not found: Can't resolve 'next/navigation'
The aforementioned <ClerkProvider />
component contains code for both Next.js 12 (+ older) and Next.js 13 (+ newer). On older versions it can't find the imports only available in newer versions.
If you're seeing these errors, you have to do two things:
Update @clerk/nextjs
to this version
Update your next.config.js
to ignore these imports:
const webpack = require('webpack');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack(config) {
config.plugins.push(
new webpack.IgnorePlugin({ resourceRegExp: /^next\/(navigation|headers|compat\/router)$/ }),
);
return config;
},
};
module.exports = nextConfig;
It is safe to ignore these modules as your Next.js 12 app won't hit these code paths.
Published by clerk-cookie 11 months ago
Published by clerk-cookie 11 months ago
a62479810
]:
Published by clerk-cookie 11 months ago
Published by clerk-cookie 11 months ago
a62479810
]:
Published by clerk-cookie 11 months ago
a62479810
]:
Published by clerk-cookie 11 months ago
a62479810
]:
Published by clerk-cookie 11 months ago
a62479810
]:
Published by clerk-cookie 11 months ago
a62479810
]: