Can we add #swift to the list of <#843999948717555...
# ideas-and-suggestions
m
Can we add #swift to the list of #843999948717555735 channels?
s
For now just post in the #843999948717555735 channel, we don't want to have too many channels which aren't being used. If there is more of a demand for swift help then we will create this channel.
m
That's fine, I'm developing a swift package to make this fully usable in iOS, so just and FYI it might be needed in the future
Thank you for the recommendation
s
Did you see the supabase swift package? https://github.com/supabase/supabase-swift
It might be better sending PRs to that
m
Yeah we saw it, there's no documentation for half of the repo haha
We're going to make it! 🙂
Excellent!
l
do you plan to include auth in the package as well?
m
Yes that’s where we started! 😃
l
Thats awesome plzzz let me know when there's a early brand/git we can use -- we've been struggling a tad with login/signup/ refreshing session . hell even if its a couple lines of code until the full repo is pushed haha
m
We're going to try and get auth out within the next two weeks. I have a personal dead line to release Auth by 09/13
l
awesome. looking forward to
m
Where is your current struggle?
l
until then -- how are you handling refresh token /checking if the current user session is still valid?
m
We haven't gotten that far yet, we just started this yesterday haha. I'll let you know as soon as we get to it.
we're building the HTTP client today
We've already got all the Auth API calls working in Postman! 🙂
l
ha okay. nice. We're currently sending everything over to our api. we've tried hitting the
supabase.auth.api.refreshAccessToken
but we get a
Copy code
{
  "code": 400,
  "msg": "Could not read refresh token grant params: EOF"
}
have you been able to use the
/token?grant_type=refresh_token
endpoint in postman?
m
Yes, I think I can help
l
🙏
any help would be grateful
Try this instead
"https://{yoursupabaseurl}.supabase.co/auth/v1/token?grant_type=refresh_token&apikey={APIKEY}"
l
giving it a go now
so a Post returns
Copy code
{
  "error": "invalid_grant",
  "error_description": "Invalid Refresh Token"
}
on postman im also passing in a body of type raw with
Copy code
{
    "refresh_token": REFRESHTOKEN
}
m
postman?
l
Postman to test the api
m
I'm getting the same error, I had it happen twice yesterday. It has to do with manually updating the tokens after you refresh
I'll fix my error and then explain how I fixed it
l
im guessing this is becuase you've already refreshed the token and now the old token is expired?
m
Yes exactly
Sign in again, grab the refresh token from the response. That refresh token is used to generate a new token. The documentation doesn't say, but I believe the refresh token also expires with access token.
I was able to fix my error
Let me know if you still need help
l
im going to give it a shot now
also just a thought -- it is possible to have multiple sessions correct? i.e. - a user logged into web, mobile, etc. i know it sounds like a noob question lol but i think thats where some of the session token issue might have been coming from with using a refresh token from a web user that has been refreshed already
also - thanks for your help
m
I’m not sure yet, I would assume you can have multiple sessions. We’ll be sure to test that soon.
r
I was wondering if there’s active development of the swift client?
p
Any update on a swift library? Would rather use a native library instead of building an api wrapper around a js client..