Comments (4)
Thanks. Turns out that the refreshToken
is the Twitter accessTokenSecret
.
from next-auth.
Thanks for leaving a comment for others!
This inconsistency between oAuth APIs (because the standard isn't explicit) is such a huge pain and endless confusion (and almost impossible to remember and track over time).
I might document the different names for properties in popular services in a table in the README (e.g. client/secret/key/access token/etc) so it's clearer.
from next-auth.
Hi there, yes (I think; I have not checked but it should work…).
The second parameter passed to the insert()
function in next-auth.functions.js returns the full, raw profile object as returned by whatever oAuth service you are using - so if it is returned by the service you should be able to see it there.
insert: (user, oAuthProfile) => {
return new Promise((resolve, reject) => {
usersCollection.insert(user, (err, response) => {
if (err) return reject(err)
// Mongo Client automatically adds an id to an inserted object, but
// if using a work-a-like we may need to add it from the response.
if (!user._id && response._id) user._id = response._id
return resolve(user)
})
})
}
from next-auth.
Note: The insert()
method is called only on account creation, I don't think the update()
method also gets the raw profile from the oAuth provider as an option.
It's like this because APIs like Google normally only provide things like Refresh Tokens and other things you might want to capture on first login, but if if you have users with accounts already and want to capture them with update()
I'm happy to add oAuthProfile
as an additional parameter to update()
too.
(This is a useful enquiry for the next update, thank you.)
from next-auth.
Related Issues (20)
- Improve Auth.js Intro HOT 2
- next.js 14.2.1 gives 404 on /auth/signin HOT 14
- authjs.session-token send to backend but is error HOT 1
- JWT strings must contain exactly 2 period characters. Found: 4 HOT 2
- Unexpected Modification of User Object in Next.js Authentication Callback HOT 1
- Property 'authorization' does not exist on type... HOT 1
- Active Directory Integration HOT 1
- Documentation doesn't make clear that update() from useSession() doesn't log you out HOT 2
- error on middleware documentation link HOT 1
- Sveltekit Custom Error Pages within /auth path HOT 4
- Eve online provider jwt session error HOT 1
- So are we supposed to expose AUTH_SECRET publicly? HOT 1
- Set Session Cookie missing from azure-ad callback in production HOT 1
- Set Session Cookie missing from azure-ad callback in production #10613 HOT 1
- Broken link on https://authjs.dev/concepts/faq#security HOT 2
- v5 Microsoft Entra docs reference provider that doesn't exist in @auth/[email protected] / 5.0.0-beta.16 HOT 2
- Postmark provider missing HOT 1
- Azure AD B2C authorization code flow fails because of validation of "expires_in" value returned in token response HOT 1
- Broken link in tutorial documentation HOT 1
- Detect Origin Function is not configurable by the auth options which cause issues for multi tenancy across subdomains HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-auth.