Yōten: A social tracker for your language learning journey built on the atproto.

fix(oauth): authorised client error on fresh sessions

During the callback phase of oauth, we check to see if a user account
exists in the pds and if not, create one. This requires an authorised
client. This fixes an issue where the client authorised client wasn't
grabbed successfully out of the session.

Signed-off-by: brookjeynes <me@brookjeynes.dev>

authored by brookjeynes.dev and committed by Tangled 535d3c93 d3aceeb3

Changed files
+3 -1
internal
server
oauth
+3 -1
internal/server/oauth/handler.go
··· 107 107 return 108 108 } 109 109 110 - client, err := o.AuthorizedClient(r) 110 + clientSession, err := o.ClientApp.ResumeSession(r.Context(), sessData.AccountDID, sessData.SessionID) 111 111 if err != nil { 112 112 l.Error("failed to get authorized client", "err", err) 113 113 http.Redirect(w, r, "/login?error=client", http.StatusFound) 114 114 return 115 115 } 116 + 117 + client := clientSession.APIClient() 116 118 117 119 ex, _ := comatproto.RepoGetRecord(r.Context(), client, "", yoten.ActorProfileNSID, did, "self") 118 120 var cid *string