Custom login ( How to make a "Remember Me" function using wix code?)

Hi Ruger ,

You can use wix-localStorage to save the data, For more information about localStorage, check this out : Here

Best,
Mustafa

Hi, did you come right? I want to add the remember me as well to my custom login page.

I’m still struggling with this one

What is not to know from the api page:
https://www.wix.com/code/reference/wix-storage.html
http://intense-brook-61045.herokuapp.com/wix-storage.html

Wix Storage
The wix-storage module contains functionality for the persistent storage of key/value data in the user’s browser.There are two types of storage:

Local: Data in local storage never expires, even if the user closes your page. When the user reopens the page later, the data can still be retrieved.

Session: Data in session storage is available while the user’s web session is active. The session ends when the user closes the browser tab or window. When the session ends, all the data in session storage is lost. Reloading or restoring the page does not affect session storage data.

To use the Storage API, import the needed storage type(s) from the wix-storage module:

import {local, session} from 'wix-storage';

// Or one of:

import {local} from 'wix-storage';
import {session} from 'wix-storage';

The APIs in wix-storage can only be used in front-end code.

It clearly details the difference between local and session storage and how to apply the code in the examples shown…

Store an item in session storage

import {session} from 'wix-storage';

// ...

session.setItem("key", "value");

Retrieve an item from session storage

import {session} from 'wix-storage';

// ...

let value = session.getItem("key"); // "value" 

Just add a simple checkbox from user input and add in the code that when the checkbox is ticked for remember me, that the item is stored in session storage and retrieved from session storage if needed.

Or another way is to use third party authentication option which will generate a session token for you and then apply the session token if everything is correct, with the code mostly written for you in this api guide:
https://www.wix.com/code/reference/wix-users-backend.html#currentUser

Have a read of these previous posts too:
https://www.wix.com/code/home/forum/community-discussion/access-login-protected-third-party-endpoint
https://www.wix.com/code/home/forum/community-discussion/google-identity-platform-oauth-2
https://www.wix.com/code/home/forum/community-discussion/google-client-api-oauth2-rawabi
https://www.wix-forum-community.com/forum/wish-list/oauth-member-login
and
https://support.wix.com/en/article/wix-code-security-considerations#api-keys