Cross platform authentication
What would you recommend for authentication in a cross platform (web / mobile) application?
tRPC will be used for BE and for DB I'm not certain but leaning towards a postgres db handled through Prisma
94 Replies
You authenticate on server, I'd recommend drawing up your architecture it's really useful for questions like this.
Also I don't really recommend prisma but that may be a hot take around here
I've mainly looked at what type of stack I want to utilise.
This is what I'm considering using right now:
FE Related:
Other things
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
If you're used to working in React Native its very intuitive imo. When It comes to UI sharing it's most of the time super simple. Why don't you think it's a right decision other than you not thinking it's intuitive?
I've heard that they don't really have support for mobile but that might be wrong?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That's why I'll be using NativeBase since they have already done a lot of the thinking for me to support both web and mobile with their component library.
They also say that their performance will have improved quite a lot with 3.5 release.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Yeah it's a component lib.
I'm mainly using NativeBase to test it out to see if we could base a design system on top of theirs to have a single design system for both web and mobile
Have you looked into Expo for react native and web instead of Solito btw?
Yeah I've tried that out before but Solito has been way smoother for me at least.
Interesting, do you know someone or company who has successfuly deployed their app with Solito to the playstore and web?
For authentication you could also go completely passwordless too, this way you dont have to worry about cross platform issues
BeatGig
Book Talent on BeatGig
Yeah I think I'd like having phone number authentication with OTP
potentially email link on web and OTP on mobile
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
yeah I don't expect kids to use my platform.
bankID would be the preferred solution if I wanted to pay for auth ^^ (Swedish authentication method)
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
OTP is probably the one I'd be most interested in if I could get it for free but I'm only aware of Firebase having that for "free".
If I go with Google then I have to add Apple as well on iOS
firebase has it for Free? 😮
Yeah I think up to like 10k or so iirc.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Yeah we use Firebase with .NET API and RN app in one of the projects I'm working on (I'm glad I don't have to touch any of the .NET stuff though 😄 )
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Firebase is google
So make sense why it isnt open sourced
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
wait why xD
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Gotchya, Yeah I just used firebase in react native for Notification , Google, Facebook auth and some Deep Linking tbh. I havent used their DB ever, not planning too either
Hows Supabase? Do they also have all these services firebase provides?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ah I see, So supabse is just a Db only? unlike firebase that provides a bunch of service
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That's interesting, need to checkout this Supabase soon
@An7 At what point do you come out of BaaS? Once it starts scaling ?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
What scales well?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Modern compute is pretty easy to scale in a lot of cases, it's the db that's the problem aha
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I'm skeptical on writing API in NextJs, So I stick to Nodejs currently
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Prisma is just an orm right? It's the backing db that matters
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Right which is mysql
yeah thats what I thought too
God I hate orms
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I'm hardcore front end + mobile dev, but watching theo's stream inspired me to start backend
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Yeah I looked into Prisma, Its a game changer tbh
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
What about scaling to multiple apps or when you need to update the sql directly
To be on the same page from a backend newbie, what is Edge or Edge Functions lol
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
You should do some systems architecture designs 😄 really helps think about all that stuff
I believe you could always write custom sql even if you use prisma?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I just always prefer to write custom sql so the orms don't bring much benefit and have caused me so much headache
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Isnt migration a pain? Prisma eases that beautifully
Like migration scripts? Not really I use flyway which runs sql
Migrations should 100% be written in sql
So basically my login endpoint is a function you mean? and we call that edge?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Most of my thoughts are for industry and businesses, they don't apply as much to personal projects btw
If its just you working on something go wild on whatever makes you fast and you enjoy aha
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
dang, so many buzz words, I'll need to look into all these words in depth haha
Ah have you not ran into any? It is definately useful
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
You can learn some in advance
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Because then you can join companies with the same problems
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
But you should know some stuff right?
You can learn a lot
Also knowing what you don't know is important
I feel bad for ashley, we just completely diverted the topic 😂
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
right, so the conclusion is you recommended next-auth?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
yes and firebase auth is free atleast it was the last time i used it
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
speaking of bases,I heard there is something called Pocketbase
and its open source
I believe it also has Auth
PocketBase - Open Source backend in 1 file
Open Source backend in 1 file with realtime database, authentication, file storage and admin dashboard
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Imagine AWS introducing AWS Auth xD
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
S3 is bad?
I just told my client 2days ago to get Ec2 and S3 LOL
they were using azure, and aint no way I'm using that after just getting into backend
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
You mean Cognito? ^^
https://aws.amazon.com/cognito/
Amazon Web Services, Inc.
Customer Identity and Access Management – Amazon Cognito – Amazon W...
Amazon Cognito is a developer-centric and cost-effective customer identity and access management (CIAM) service that scales to millions of users.
oh wow
50,000 active users free per month? 😮
I'm waiting for Cloudflares S3 alternate to come out, I believe its in beta right now
It might destroy S3
For free, I used to use Cloudinary, but hella expensive
Don't think you can destroy s3
@An7 btw speaking of Fastify , Expressjs still has 27M downloads a week
So I dont think fastify is going to be popuplar as express anytime soon
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Express is good enough for most things, if you architecture your app nicely it should also be trivial to swap over
Hi @An7 I am trying out your draft PR and almost have it working. I am running into an issue where the expo app is trying to connect to connect to
http://localhost:3000/api/auth/proxy
when signing in instead of the serverUrl I have set http://192.168.0.132:3000
. I have tried a few things like set the .env NEXTAUTH_URL=http://192.168.0.132:3000
in the expo app as well as used <SessionProvider baseUrl={serverUrl}>
but it still seems to be connecting to localhost.
I have used @albastru repo https://github.com/DavidIlie/t3-all-inclusive as a guide as well. Any idea on how I can go about setting the serverBaseUrl correctly?GitHub
GitHub - DavidIlie/t3-all-inclusive: Best monorepo (mobile+web) for...
Best monorepo (mobile+web) for the T3 Stack! Contribute to DavidIlie/t3-all-inclusive development by creating an account on GitHub.
serverUrl for expo you can find in the constants file in lib
if i remember correctly
That did not work for me. I was able to fix it by adding this to app.json
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
OK that makes sense thanks. Now you can still make use of the env file