Comments (6)
OK, I''ll try to do it today =)
from auth.
@awalias as far as i understand you want just standardise answers and add to magic link response empty json answer?
from auth.
if successful the response should just be {}
if MaxFrequency is broken then we should probably return an error with 429 response code
the problem is we need to suppress the json response from the SignUp method here and here
from auth.
@awalias in cases when SignUp method respond with some error - do we need show same error which reterned from that method?
I have one option for dealing with response from SignUp method. Just implement struct, that fits Response interface and handle response.
For example:
Response stub code
type responseStub struct {
}
func (rw *responseStub) Header() http.Header {
return nil
}
func (rw *responseStub) Write(data []byte) (int, error) {
return 0, nil
}
func (rw *responseStub) WriteHeader(statusCode int) {
}
Magic link code
...
if config.Mailer.Autoconfirm {
// signups are autoconfirmed, send magic link after signup
if err := a.Signup(fakeResponse, r); err != nil {
// TODO: handle error
w.Write(nil)
}
newBodyContent := `{"email":"` + params.Email + `"}`
r.Body = ioutil.NopCloser(strings.NewReader(newBodyContent))
r.ContentLength = int64(len(newBodyContent))
return a.MagicLink(fakeResponse, r)
}
// otherwise confirmation email already contains 'magic link'
if err := a.Signup(w, r); err != nil {
// TODO: handle error
w.Write(nil)
}
return sendJSON(w, http.StatusOK, make(map[string]string))
....
I'm not sure that this solution is "good". What do you think about that?
from auth.
I think it's ok, If you want to make a PR I can test it out today 👍
from auth.
nice one @icecream78 !!
from auth.
Related Issues (20)
- Invalid HELO message for smtp relays - w/Solution Proposal HOT 1
- Signout fails after user account has been deleted
- Facebook Social Auth signInWithIdToken needs custom parser
- AuthApiError: Error invoking access token hook. HOT 7
- Anonymous user identity not linking HOT 3
- Error when using oauth with provider linkedin_oidc - Error getting user profile from external provider HOT 10
- The docker self hosting SERVICE_ROLE_KEY and ANON_KEY generators seem to be broken: HOT 1
- Keycloak Authorization PKCE s256/S256
- Unable to delete user if `encrypted_password` is set to `null` HOT 1
- `supabase.auth.admin.updateUserById()` return error `AuthRetryableFetchError status 504` HOT 1
- LinkedIn Auth Errror - OIDC: id token issued by a different provider HOT 8
- OAuth - State parameter not working HOT 1
- Error getting user email from external provider only with public Azure /consumers/ tenant
- Cant log out deleted user with supabase.auth.signOut() HOT 3
- jwt anonKey and serviceKey with valid iss value HOT 1
- Can't send OTPs with MessageBird for Auth - access key invalid HOT 2
- Apple Native Sign In : { "__isAuthError": true, "name": "AuthApiError", "status": 400 } HOT 2
- Event indicating that the confirmation of `updateUser` was successful HOT 2
- AuthApiError: Error invoking access token hook with custom claim HOT 8
- auth.sms.test_otp w/ international numbers HOT 4
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 auth.