我首先在一个域app.example.com
中创建了rails应用程序,在另一个域www.example.com
中创建了静态站点。然后在rails应用程序中添加了devise
gem,并在静态站点中创建了登录表单。以下是登录表单的代码:
<form action="app.example.com/users/sign_in" method="post">
<input name="utf8" type="hidden" value="✓">
Email:<input type="text" name="email" value="admin@gmail.com">
Password:<input type="password" name="password" value="password">
<input name="authenticity_token", value="", type="hidden">
<button>Submit</button>
</form>
有没有可能在从静态站点登录后重定向到rails应用程序,因为它需要authenticity_token,很难在静态站点中生成authenticity_token,而且还可能存在csrf
的问题。
https://stackoverflow.com/questions/51582552
复制相似问题