小编S H*_*S H的帖子

路径上的合并冲突(Angular)

我明白了

路径“/src/app/employee.service.ts”上的合并发生冲突。

当运行这个命令时

ng 生成服务员工 --skipTests=true

我的操作系统是 Ubuntu 20.04 。我已经搜索了 1 小时的解决方案,但没有成功

npm typescript angular

2
推荐指数
1
解决办法
8536
查看次数

spring boot mfa totp 登录代码验证不起作用

我正在尝试使用 totp 在我的应用程序中实现 MFA 身份验证。波纹管是我使用的库。注册用户一切顺利,我收到了二维码,扫描它并每 30 秒在谷歌身份验证器中获取一次代码。当我尝试登录以验证代码时,代码验证不起作用(在身份验证服务中,方法验证)。我花了几个小时但无法弄清楚,尝试了不同的用户、日志但没有成功。

<dependency>
            <groupId>dev.samstevens.totp</groupId>
            <artifactId>totp</artifactId>
            <version>1.7.1</version>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

这是我的代码

AuthContoller.java


import com.example.jsonfaker.model.dto.LoginRequest;
import com.example.jsonfaker.model.dto.SignupRequest;
import com.example.jsonfaker.model.dto.VerifyRequest;
import com.example.jsonfaker.service.Exporter;
import com.example.jsonfaker.service.UserAuthService;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/auth")
@CrossOrigin
public class AuthController {
    private final Exporter exporter;

    private final UserAuthService userAuthService;

    public AuthController(Exporter exporter, UserAuthService userAuthService) {
        this.exporter = exporter;
        this.userAuthService = userAuthService;
    }

    @PostMapping("/login")
    public ResponseEntity<String> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {
        String response = userAuthService.login(loginRequest);
        return ResponseEntity
                .ok()
                .body(response); …
Run Code Online (Sandbox Code Playgroud)

java authentication spring-boot totp

0
推荐指数
1
解决办法
2079
查看次数

标签 统计

angular ×1

authentication ×1

java ×1

npm ×1

spring-boot ×1

totp ×1

typescript ×1