mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3474d3e250 | ||
|
|
a35c3a424c | ||
|
|
6e65ba87a6 | ||
|
|
ae7247f14f | ||
|
|
12a5d6b1f4 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "next-auth",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "Authentication for Next.js",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"repository": "https://github.com/nextauthjs/next-auth.git",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createConnection, getConnection } from 'typeorm'
|
||||
import { createHash } from 'crypto'
|
||||
import require_optional from 'require_optional'
|
||||
import require_optional from 'require_optional' // eslint-disable-line camelcase
|
||||
|
||||
import { CreateUserError } from '../../lib/errors'
|
||||
import adapterConfig from './lib/config'
|
||||
@@ -171,7 +171,7 @@ const Adapter = (typeOrmConfig, options = {}) => {
|
||||
|
||||
async function updateUser (user) {
|
||||
debug('UPDATE_USER', user)
|
||||
return manager.save(user)
|
||||
return manager.save(User, user)
|
||||
}
|
||||
|
||||
async function deleteUser (userId) {
|
||||
@@ -266,7 +266,7 @@ const Adapter = (typeOrmConfig, options = {}) => {
|
||||
if (!force) { return null }
|
||||
}
|
||||
|
||||
return manager.save(session)
|
||||
return manager.save(Session, session)
|
||||
} catch (error) {
|
||||
logger.error('UPDATE_SESSION_ERROR', error)
|
||||
return Promise.reject(new Error('UPDATE_SESSION_ERROR', error))
|
||||
|
||||
@@ -19,7 +19,7 @@ export default (options) => {
|
||||
name: profile.localizedFirstName + ' ' + profile.localizedLastName,
|
||||
email: null,
|
||||
image: null
|
||||
};
|
||||
}
|
||||
},
|
||||
...options
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ export default async (req, res, userSuppliedOptions) => {
|
||||
res.json({ csrfToken })
|
||||
return done()
|
||||
case 'signin':
|
||||
if (options.pages.signIn) {
|
||||
if (options.pages.signIn) {
|
||||
let redirectUrl = `${options.pages.signIn}${options.pages.signIn.includes('?') ? '&' : '?'}callbackUrl=${options.callbackUrl}`
|
||||
if (req.query.error) { redirectUrl = `${redirectUrl}&error=${req.query.error}` }
|
||||
return redirect(redirectUrl)
|
||||
|
||||
@@ -46,9 +46,10 @@ export default ({ req, csrfToken, providers, callbackUrl }) => {
|
||||
|
||||
return render(
|
||||
<div className='signin'>
|
||||
{errorMessage && <div className='error'>
|
||||
{errorMessage}
|
||||
</div>}
|
||||
{errorMessage &&
|
||||
<div className='error'>
|
||||
{errorMessage}
|
||||
</div>}
|
||||
{providersToRender.map((provider, i) =>
|
||||
<div key={provider.id} className='provider'>
|
||||
{provider.type === 'oauth' &&
|
||||
|
||||
@@ -203,8 +203,8 @@ Pages specified will override the corresponding built-in page.
|
||||
|
||||
```js
|
||||
pages: {
|
||||
signin: '/auth/signin',
|
||||
signout: '/auth/signout',
|
||||
signIn: '/auth/signin',
|
||||
signOut: '/auth/signout',
|
||||
error: '/auth/error', // Error code passed in query string as ?error=
|
||||
verifyRequest: '/auth/verify-request', // (used for check email message)
|
||||
newUser: null // If set, new users will be directed here on first sign in
|
||||
|
||||
@@ -134,5 +134,5 @@ You can use the `getToken()` helper function in any application as long as you s
|
||||
:::note
|
||||
Pass `getToken` the same value for `secret` as specified in `pages/api/auth/[...nextauth].js`.
|
||||
|
||||
See [the documentation for the JWT option](http://localhost:3000/configuration/options#jwt) for more information.
|
||||
See [the documentation for the JWT option](/configuration/options#jwt) for more information.
|
||||
:::
|
||||
|
||||
@@ -35,7 +35,7 @@ module.exports = {
|
||||
'providers/gitlab',
|
||||
'providers/google',
|
||||
'providers/identity-server4',
|
||||
"providers/linkedin",
|
||||
'providers/linkedin',
|
||||
'providers/mixer',
|
||||
'providers/okta',
|
||||
'providers/slack',
|
||||
@@ -43,6 +43,6 @@ module.exports = {
|
||||
'providers/twitch',
|
||||
'providers/twitter',
|
||||
'providers/yandex'
|
||||
],
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ function Home () {
|
||||
<div className='hero-wave-inner' />
|
||||
</div>
|
||||
</header>
|
||||
<main className='home-main'>
|
||||
<main className='home-main'>
|
||||
<section className={`section-features ${styles.features}`}>
|
||||
<div className='container'>
|
||||
<div className='row'>
|
||||
|
||||
Reference in New Issue
Block a user