fix: backend (#1481)

* fix: check ids in proto

* fix sign out

* improve displayed login name after user selection

* fix init user in login

* fix init password in login

Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz 2021-03-26 16:29:26 +01:00 committed by GitHub
parent 31b542015e
commit c0b37924c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 19 deletions

View File

@ -244,7 +244,11 @@ func (repo *AuthRequestRepo) SelectUser(ctx context.Context, id, userID, userAge
if request.RequestedOrgID != "" && request.RequestedOrgID != user.ResourceOwner {
return errors.ThrowPreconditionFailed(nil, "EVENT-fJe2a", "Errors.User.NotAllowedOrg")
}
request.SetUserInfo(user.ID, user.UserName, user.PreferredLoginName, user.DisplayName, user.ResourceOwner)
username := user.UserName
if request.RequestedOrgID == "" {
username = user.PreferredLoginName
}
request.SetUserInfo(user.ID, username, user.PreferredLoginName, user.DisplayName, user.ResourceOwner)
return repo.AuthRequests.UpdateAuthRequest(ctx, request)
}

View File

@ -372,7 +372,7 @@ type HumanSignedOutEvent struct {
}
func (e *HumanSignedOutEvent) Data() interface{} {
return nil
return e
}
func (e *HumanSignedOutEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {

View File

@ -36,15 +36,17 @@
{{ template "error-message" .}}
<button type="submit" name="resend" value="true" class="lgn-button lgn-primary block" formnovalidate>{{t "Actions.Resend" }}</button>
<div class="lgn-actions lgn-reverse-order">
<!-- position element in header -->
<a class="lgn-icon-button lgn-left-action" href="{{ loginUrl }}">
<i class="lgn-icon-arrow-left-solid"></i>
</a>
<button type="submit" id="init-button" name="resend" value="false"
class="lgn-raised-button lgn-primary">{{t "Actions.Next"}}</button>
<span class="fill-space"></span>
<a class="lgn-stroked-button lgn-primary" href="{{ loginUrl }}">
{{t "Actions.Cancel"}}
</a>
<button type="submit" name="resend" value="true" class="lgn-stroked-button" formnovalidate>{{t "Actions.Resend" }}</button>
</div>
</form>

View File

@ -21,9 +21,6 @@
required>
</div>
<button class="lgn-button lgn-primary block" type="submit" name="resend" value="true"
formnovalidate>{{t "Actions.Resend" }}</button>
{{ if not .PasswordSet }}
<div class="field">
<label class="lgn-label" for="password">{{t "InitUser.NewPassword"}}</label>
@ -43,13 +40,18 @@
{{ template "error-message" .}}
<div class="lgn-actions">
<a class="lgn-stroked-button lgn-primary" href="{{ loginUrl }}">
{{t "Actions.Cancel"}}
<div class="lgn-actions lgn-reverse-order">
<!-- position element in header -->
<a class="lgn-icon-button lgn-left-action" href="{{ loginUrl }}">
<i class="lgn-icon-arrow-left-solid"></i>
</a>
<span class="fill-space"></span>
<button type="submit" id="init-button" name="resend" value="false"
class="lgn-primary lgn-raised-button">{{t "Actions.Next"}}</button>
<span class="fill-space"></span>
<button type="submit" name="resend" value="true" class="lgn-stroked-button" formnovalidate>{{t "Actions.Resend" }}</button>
</div>
</form>

View File

@ -827,7 +827,7 @@ service ManagementService {
option (zitadel.v1.auth_option) = {
permission: "project.role.write"
check_field_name: "Id"
check_field_name: "ProjectId"
};
}
@ -840,7 +840,7 @@ service ManagementService {
option (zitadel.v1.auth_option) = {
permission: "project.role.write"
check_field_name: "Id"
check_field_name: "ProjectId"
};
}
@ -852,7 +852,7 @@ service ManagementService {
option (zitadel.v1.auth_option) = {
permission: "project.role.write"
check_field_name: "Id"
check_field_name: "ProjectId"
};
}
@ -864,7 +864,7 @@ service ManagementService {
option (zitadel.v1.auth_option) = {
permission: "project.role.delete"
check_field_name: "Id"
check_field_name: "ProjectId"
};
}
@ -910,7 +910,7 @@ service ManagementService {
option (zitadel.v1.auth_option) = {
permission: "project.member.write"
check_field_name: "Id"
check_field_name: "ProjectId"
};
}