mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-22 13:59:24 +00:00
feat: add ability to define expiration of one time link
This commit is contained in:
@@ -42,10 +42,10 @@ export default class UserService extends APIService {
|
||||
await this.api.delete(`/users/${id}`);
|
||||
}
|
||||
|
||||
async createOneTimeAccessToken(userId: string) {
|
||||
async createOneTimeAccessToken(userId: string, expiresAt: Date) {
|
||||
const res = await this.api.post(`/users/${userId}/one-time-access-token`, {
|
||||
userId,
|
||||
expiresAt: new Date(Date.now() + 1000 * 60 * 5).toISOString()
|
||||
expiresAt
|
||||
});
|
||||
return res.data.token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user