fix: magic link login while invite only

This commit is contained in:
Tristan Yang
2022-06-22 22:21:30 +08:00
parent 3e23c72b6d
commit cce4778c3a
5 changed files with 37 additions and 13 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
import { useState, useEffect } from "react";
import toast from "react-hot-toast";
// import { useNavigate } from "react-router-dom";
import BASE_URL from "../../app/config";
import BASE_URL, { KEY_LOCAL_MAGIC_TOKEN } from "../../app/config";
import Input from "../../common/component/styled/Input";
import Button from "../../common/component/styled/Button";
import { useLazyCheckEmailQuery, useSendRegMagicLinkMutation } from "../../app/services/auth";
@@ -30,6 +30,8 @@ export default function Reg() {
// const githubCode = query.get("gcode");
const token = query.get("magic_token");
if (token) {
//本地存一下 magic token 后续oauth流程用到
localStorage.setItem(KEY_LOCAL_MAGIC_TOKEN, token);
setMagicToken(token);
}
}, []);