NextAuth Callbacks
I'm currently trying to implement my nextauth instance in an ios app, but im having some trouble implementing callbacks that pass the session id and user id/token back to the app. I'm currently just using the credentials authOption, but if anyone could point me in the right direction that would be great. Thanks!
I haven't changed much from the base t3 stack app besides adding the passwordHash functionalities.
4 Replies
Hey, i've done something very similar to you for my app
I noticed you have db adapter so you may have to use database strategy for the session instead of jwt
Then in your session callback you can add a primsa call to db to fetch tokens and etc
Something like this (i'm using drizzle) ^
I have added a accessToken return to the session callback method but I am not seeing any response on the iOS app
https://gist.github.com/cnbrown04/691740e41d6c5420aaae3cee85d05329 This is my swift code, any suggestions?
I’ve updated my callback url to the correct url and it’s returning the scheme and host but not the token