-
Notifications
You must be signed in to change notification settings - Fork 81
Support Authgear Once user provision #4937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Authgear Once user provision #4937
Conversation
| # The use of variables | ||
| # | ||
| # We use simply expanded variables in this Makefile. | ||
| # | ||
| # This means | ||
| # 1. You use ::= instead of = because = defines a recursively expanded variable. | ||
| # See https://www.gnu.org/software/make/manual/html_node/Simple-Assignment.html | ||
| # 2. You use ::= instead of := because ::= is a POSIX standard. | ||
| # See https://www.gnu.org/software/make/manual/html_node/Simple-Assignment.html | ||
| # 3. You do not use ?= because it is shorthand to define a recursively expanded variable. | ||
| # See https://www.gnu.org/software/make/manual/html_node/Conditional-Assignment.html | ||
| # You should use the long form documented in the above link instead. | ||
| # 4. When you override a variable in the command line, as documented in https://www.gnu.org/software/make/manual/html_node/Overriding.html | ||
| # you specify the variable with ::= instead of = or := | ||
| # If you fail to do so, the variable becomes recursively expanded variable accidentally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you find any problem with the original ?= recursively expanded variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem in our current usage. I just learnt this today and realized we are not very consistent with the use of the variables. We never intent to use recursively expanded variables.
pkg/portal/service/collaborator.go
Outdated
| inviteeExists, err := s.checkInviteeExistenceByEmail(ctx, invitedBy, inviteeEmail) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| if !inviteeExists { | ||
| err = s.createAccountForInvitee(ctx, invitedBy, inviteeEmail) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New developers (If any) reading this part may be confused:
Why createAccountForInvitee is called but actually no account created?
What about:
// In CollaboratorService.SendInvitation
if IsAuthgearOnce {
// ... checkInviteeExistenceByEmail
// ... createAccountForInvitee
}
// In another file
//go:build !authgearonce
// +build !authgearonce
const IsAuthgearOnce = false
// In another file
//go:build authgearonce
// +build authgearonce
const IsAuthgearOnce = true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, let me make the change according to your suggestion.
b11c96d to
12cdeec
Compare
ref DEV-2341