Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

授权页面表单代码问题 #4

Closed
LeeAli opened this issue Nov 19, 2018 · 1 comment
Closed

授权页面表单代码问题 #4

LeeAli opened this issue Nov 19, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@LeeAli
Copy link

LeeAli commented Nov 19, 2018

你的代码是有问题的,如果以你这种方式的话默认,授权范围默认是false,直接导致授权失败,正确代码应该如下
<form method="post" th:action="@{/oauth/authorize}"> <input type="hidden" name="user_oauth_approval" value="true"> <input type="hidden" name="_csrf" th:value="${_csrf.getToken()}"/> <div class="form-check"> <input type="checkbox" class="form-check-input" checked="checked" id="exampleCheck1"> <label class="form-check-label" for="exampleCheck1">昵称,身份和头像</label> </div> <div th:each="item:${scopes}"> <input type="radio" th:name="'scope.'+${item}" value="true" hidden="hidden" checked="checked"> </div> <p class="card-text" style="color: #dc3545;font-size: 12px">授权后表表明您已同意Oauth2协议</p> <button type="submit" class="btn btn-outline-danger">同意授权</button> </form>

@LookBackInTheRain
Copy link
Owner

感谢提醒,粗心了

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants